snapshot of project "mawk", label t20241213

This commit is contained in:
Thomas E. Dickey 2024-12-14 01:35:23 +00:00
parent 462cc4cf90
commit c978ff1677
No known key found for this signature in database
GPG Key ID: CC2AF4472167BE03
12 changed files with 55 additions and 17 deletions

View File

@ -1,4 +1,7 @@
-- $MawkId: CHANGES,v 1.409 2024/12/13 00:44:41 tom Exp $
-- $MawkId: CHANGES,v 1.411 2024/12/14 01:09:36 tom Exp $
20241213
+ disallow reading from a directory like a file (Original-Mawk #83).
20241212
+ modify calls on stdtod() to disallow hexadecimal, infinite and

View File

@ -1,4 +1,4 @@
MANIFEST for mawk, version t20241212
MANIFEST for mawk, version t20241213
--------------------------------------------------------------------------------
MANIFEST this file
ACKNOWLEDGMENT acknowledgements

View File

@ -11,7 +11,7 @@ the GNU General Public License, version 2, 1991.
********************************************/
/*
* $MawkId: config_h.in,v 1.42 2024/11/17 22:07:11 tom Exp $
* $MawkId: config_h.in,v 1.43 2024/12/14 01:12:07 tom Exp $
* template for config.h
*/
@ -28,6 +28,7 @@ the GNU General Public License, version 2, 1991.
#undef HAVE_FCNTL_H
#undef HAVE_FORK
#undef HAVE_FSEEKO
#undef HAVE_FSTAT
#undef HAVE_GETTIMEOFDAY
#undef HAVE_INT64_T
#undef HAVE_INTTYPES_H

2
configure vendored
View File

@ -11163,7 +11163,7 @@ EOF
fi
for ac_func in fork matherr mktime pipe strftime tsearch wait
for ac_func in fork fstat matherr mktime pipe strftime tsearch wait
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:11169: checking for $ac_func" >&5

View File

@ -1,4 +1,4 @@
dnl $MawkId: configure.in,v 1.76 2024/11/17 23:54:26 tom Exp $
dnl $MawkId: configure.in,v 1.77 2024/12/14 00:43:08 tom Exp $
dnl configure.in for mawk
dnl ###########################################################################
dnl copyright 2008-2023,2024, Thomas E. Dickey
@ -132,7 +132,7 @@ CF_MAWK_FIND_SIZE_T
CF_LOCALE
CF_CHECK_ENVIRON(environ)
AC_CHECK_FUNCS(fork matherr mktime pipe strftime tsearch wait)
AC_CHECK_FUNCS(fork fstat matherr mktime pipe strftime tsearch wait)
CF_FUNC_GETTIME
### Checks for libraries.

View File

@ -11,7 +11,7 @@ the GNU General Public License, version 2, 1991.
********************************************/
/*
* $MawkId: error.c,v 1.29 2024/12/11 21:57:28 tom Exp $
* $MawkId: error.c,v 1.30 2024/12/13 23:40:55 tom Exp $
*/
#define Visible_CELL
@ -190,7 +190,7 @@ errmsg(int errnum, const char *format, ...)
#if OPT_TRACE > 0
va_start(args, format);
Trace("\n?? errmsg \n");
Trace("\n?? errmsg: ");
TraceVA(format, args);
Trace("\n");
va_end(args);

16
files.c
View File

@ -11,7 +11,7 @@ the GNU General Public License, version 2, 1991.
********************************************/
/*
* $MawkId: files.c,v 1.37 2024/11/11 20:55:25 tom Exp $
* $MawkId: files.c,v 1.40 2024/12/14 01:35:10 tom Exp $
*/
#define Visible_STRING
@ -41,6 +41,11 @@ the GNU General Public License, version 2, 1991.
#define CLOSE_ON_EXEC(fd) ioctl(fd, FIOCLEX, (PTR) 0)
#endif
#ifdef HAVE_FSTAT
#include <sys/types.h>
#include <sys/stat.h>
#endif
/* We store dynamically created files on a linked linear
list with move to the front (big surprise) */
@ -635,6 +640,15 @@ tfopen(const char *name, const char *mode)
FILE *retval = fopen(name, mode);
if (retval) {
#ifdef HAVE_FSTAT
struct stat sb;
int fd = fileno(retval);
if (fstat(fd, &sb) != -1 && (sb.st_mode & S_IFMT) == S_IFDIR) {
fclose(retval);
retval = NULL;
errno = EISDIR;
} else
#endif /* HAVE_FSTAT */
if (isatty(fileno(retval)))
setbuf(retval, (char *) 0);
else {

20
fin.c
View File

@ -11,7 +11,7 @@ the GNU General Public License, version 2, 1991.
********************************************/
/*
* $MawkId: fin.c,v 1.57 2024/09/05 17:38:30 tom Exp $
* $MawkId: fin.c,v 1.60 2024/12/14 01:35:23 tom Exp $
*/
#define Visible_CELL
@ -32,6 +32,11 @@ the GNU General Public License, version 2, 1991.
#include <fcntl.h>
#endif
#ifdef HAVE_FSTAT
#include <sys/types.h>
#include <sys/stat.h>
#endif
/* This file handles input files. Opening, closing,
buffering and (most important) splitting files into
records, FINgets().
@ -125,8 +130,17 @@ FINopen(char *filename, int main_flag)
setmode(0, O_BINARY);
#endif
result = FINdopen(0, main_flag);
} else if ((fd = open(filename, oflag, 0)) != -1) {
result = FINdopen(fd, main_flag);
} else {
if ((fd = open(filename, oflag, 0)) != -1) {
#ifdef HAVE_FSTAT
struct stat sb;
if (fstat(fd, &sb) != -1 && (sb.st_mode & S_IFMT) == S_IFDIR) {
close(fd);
errno = EISDIR;
} else
#endif /* HAVE_FSTAT */
result = FINdopen(fd, main_flag);
}
}
return result;
}

View File

@ -1,3 +1,9 @@
mawk-cur (1.3.4-20241213) unstable; urgency=low
* maintenance updates
-- Thomas E. Dickey <dickey@invisible-island.net> Fri, 13 Dec 2024 20:01:15 -0500
mawk-cur (1.3.4-20241212) unstable; urgency=low
* maintenance updates

View File

@ -2,7 +2,7 @@
# $FreeBSD: head/lang/mawk/Makefile 516890 2019-11-06 14:17:48Z wen $
PORTNAME= mawk
DISTVERSION= 1.3.4.20241212
DISTVERSION= 1.3.4.20241213
CATEGORIES= lang
MASTER_SITES= https://invisible-island.net/archives/${PORTNAME}/ \
https://invisible-mirror.net/archives/${PORTNAME}/

View File

@ -1,9 +1,9 @@
Summary: mawk - pattern scanning and text processing language
%global AppProgram mawk
%global AppVersion 1.3.4
%global AppPatched 20241212
%global AppPatched 20241213
%global MySite https://invisible-island.net
# $MawkId: mawk.spec,v 1.134 2024/12/13 00:44:41 tom Exp $
# $MawkId: mawk.spec,v 1.135 2024/12/14 01:01:15 tom Exp $
Name: %{AppProgram}
Version: %{AppVersion}
Release: %{AppPatched}

View File

@ -11,9 +11,9 @@ the GNU General Public License, version 2, 1991.
*/
/*
* $MawkId: patchlev.h,v 1.161 2024/12/13 00:44:41 tom Exp $
* $MawkId: patchlev.h,v 1.162 2024/12/14 01:01:15 tom Exp $
*/
#define PATCH_BASE 1
#define PATCH_LEVEL 3
#define PATCH_STRING ".4"
#define DATE_STRING "20241212"
#define DATE_STRING "20241213"