pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/lang/nawk



Module Name:    pkgsrc
Committed By:   rillig
Date:           Sat Jul 26 05:37:47 UTC 2025

Modified Files:
        pkgsrc/lang/nawk: Makefile
        pkgsrc/lang/nawk/files: FIXES lib.c

Log Message:
lang/nawk: fix segmentation fault on NetBSD

https://mail-index.netbsd.org/tech-pkg/2025/07/09/msg031380.html


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 pkgsrc/lang/nawk/Makefile
cvs rdiff -u -r1.6 -r1.7 pkgsrc/lang/nawk/files/FIXES
cvs rdiff -u -r1.7 -r1.8 pkgsrc/lang/nawk/files/lib.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/lang/nawk/Makefile
diff -u pkgsrc/lang/nawk/Makefile:1.47 pkgsrc/lang/nawk/Makefile:1.48
--- pkgsrc/lang/nawk/Makefile:1.47      Sat Apr 19 08:07:27 2025
+++ pkgsrc/lang/nawk/Makefile   Sat Jul 26 05:37:46 2025
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.47 2025/04/19 08:07:27 wiz Exp $
+# $NetBSD: Makefile,v 1.48 2025/07/26 05:37:46 rillig Exp $
 
-DISTNAME=      nawk-20230909
+DISTNAME=      nawk-20250726
 CATEGORIES=    lang
 MASTER_SITES=  # empty
 DISTFILES=     # empty

Index: pkgsrc/lang/nawk/files/FIXES
diff -u pkgsrc/lang/nawk/files/FIXES:1.6 pkgsrc/lang/nawk/files/FIXES:1.7
--- pkgsrc/lang/nawk/files/FIXES:1.6    Wed Jul  9 17:11:22 2025
+++ pkgsrc/lang/nawk/files/FIXES        Sat Jul 26 05:37:46 2025
@@ -25,6 +25,10 @@ THIS SOFTWARE.
 This file lists all bug fixes, changes, etc., made since the AWK book
 was sent to the printers in August 1987.
 
+Jul 26, 2025:
+       Fix segmentation fault on NetBSD 10.99 due to invalid usage of the
+       character classification functions in <ctype.h>.
+
 Sep 06, 2023:
        Fix edge case where FS is changed on commandline. Thanks to
        Gordon Shephard and Miguel Pineiro Jr.

Index: pkgsrc/lang/nawk/files/lib.c
diff -u pkgsrc/lang/nawk/files/lib.c:1.7 pkgsrc/lang/nawk/files/lib.c:1.8
--- pkgsrc/lang/nawk/files/lib.c:1.7    Sun Sep 17 10:32:06 2023
+++ pkgsrc/lang/nawk/files/lib.c        Sat Jul 26 05:37:46 2025
@@ -793,11 +793,11 @@ bool is_valid_number(const char *s, bool
        if (no_trailing)
                *no_trailing = false;
 
-       while (isspace(*s))
+       while (isspace((uschar) *s))
                s++;
 
        // no hex floating point, sorry
-       if (s[0] == '0' && tolower(s[1]) == 'x')
+       if (s[0] == '0' && tolower((uschar) s[1]) == 'x')
                return false;
 
        // allow +nan, -nan, +inf, -inf, any other letter, no
@@ -805,12 +805,12 @@ bool is_valid_number(const char *s, bool
                is_nan = (strncasecmp(s+1, "nan", 3) == 0);
                is_inf = (strncasecmp(s+1, "inf", 3) == 0);
                if ((is_nan || is_inf)
-                   && (isspace(s[4]) || s[4] == '\0'))
+                   && (isspace((uschar) s[4]) || s[4] == '\0'))
                        goto convert;
-               else if (! isdigit(s[1]) && s[1] != '.')
+               else if (! isdigit((uschar) s[1]) && s[1] != '.')
                        return false;
        }
-       else if (! isdigit(s[0]) && s[0] != '.')
+       else if (! isdigit((uschar) s[0]) && s[0] != '.')
                return false;
 
 convert:
@@ -828,7 +828,7 @@ convert:
        /*
         * check for trailing stuff
         */
-       while (isspace(*ep))
+       while (isspace((uschar) *ep))
                ep++;
 
        if (no_trailing != NULL)



Home | Main Index | Thread Index | Old Index