pkgsrc-Changes archive

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

CVS commit: pkgsrc/lang/librep



Module Name:    pkgsrc
Committed By:   gutteridge
Date:           Tue Sep 30 14:29:18 UTC 2025

Modified Files:
        pkgsrc/lang/librep: Makefile distinfo
Added Files:
        pkgsrc/lang/librep/patches: patch-src_lisp.c patch-src_lispcmds.c
            patch-src_misc.c patch-src_numbers.c patch-src_regexp.c
            patch-src_streams.c patch-src_symbols.c

Log Message:
librep: use ctype.h correctly

Fixes build failures in dependent wm/sawfish (which invokes this Lisp
interpreter during builds) on NetBSD >= 10.99.14 or so.


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 pkgsrc/lang/librep/Makefile
cvs rdiff -u -r1.24 -r1.25 pkgsrc/lang/librep/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/lang/librep/patches/patch-src_lisp.c \
    pkgsrc/lang/librep/patches/patch-src_lispcmds.c \
    pkgsrc/lang/librep/patches/patch-src_misc.c \
    pkgsrc/lang/librep/patches/patch-src_numbers.c \
    pkgsrc/lang/librep/patches/patch-src_regexp.c \
    pkgsrc/lang/librep/patches/patch-src_streams.c \
    pkgsrc/lang/librep/patches/patch-src_symbols.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/librep/Makefile
diff -u pkgsrc/lang/librep/Makefile:1.68 pkgsrc/lang/librep/Makefile:1.69
--- pkgsrc/lang/librep/Makefile:1.68    Sun May 18 10:37:30 2025
+++ pkgsrc/lang/librep/Makefile Tue Sep 30 14:29:17 2025
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.68 2025/05/18 10:37:30 zafer Exp $
+# $NetBSD: Makefile,v 1.69 2025/09/30 14:29:17 gutteridge Exp $
 #
 
 DISTNAME=              librep_0.92.7
 PKGNAME=               ${DISTNAME:S/_/-/}
-PKGREVISION=           2
+PKGREVISION=           3
 CATEGORIES=            lang devel
 MASTER_SITES=          https://www.aydogan.net/distfiles/lang/
 EXTRACT_SUFX=          .tar.xz

Index: pkgsrc/lang/librep/distinfo
diff -u pkgsrc/lang/librep/distinfo:1.24 pkgsrc/lang/librep/distinfo:1.25
--- pkgsrc/lang/librep/distinfo:1.24    Tue Oct 26 10:51:41 2021
+++ pkgsrc/lang/librep/distinfo Tue Sep 30 14:29:17 2025
@@ -1,6 +1,13 @@
-$NetBSD: distinfo,v 1.24 2021/10/26 10:51:41 nia Exp $
+$NetBSD: distinfo,v 1.25 2025/09/30 14:29:17 gutteridge Exp $
 
 BLAKE2s (librep_0.92.7.tar.xz) = b43900e377cb9ff8bb0e8ce36fb5a812e2d32ec5d2d333a87b805f01ae5976b4
 SHA512 (librep_0.92.7.tar.xz) = 752cb2da31457200b5896f70ce24a097b261b996da25998cd78a777f982597473afce1a216f449a4a969d29b1678bf54e2f148e86de6f9548eeb5cfd530ae377
 Size (librep_0.92.7.tar.xz) = 651344 bytes
 SHA1 (patch-aa) = 382f6692e8a387d1492e0a2198211a6f65f41d20
+SHA1 (patch-src_lisp.c) = 1aa7352f38c889b5efb73062c7ac687364a3fe02
+SHA1 (patch-src_lispcmds.c) = e908e57e1f15e5dbdd876a8364bac6933c6b7ad0
+SHA1 (patch-src_misc.c) = b907e61c060c918e10456fa3b474bd58109e900a
+SHA1 (patch-src_numbers.c) = da798423b17a2aa84bd9f158b9e29effc7a3b18b
+SHA1 (patch-src_regexp.c) = 520a75313d44ca337d213997e5272a2e50591ad8
+SHA1 (patch-src_streams.c) = e05685ff92b4a23ca2e5d014f9eac334735a51a4
+SHA1 (patch-src_symbols.c) = 61abfc604b6b3510db02ee9b23ed846936892868

Added files:

Index: pkgsrc/lang/librep/patches/patch-src_lisp.c
diff -u /dev/null pkgsrc/lang/librep/patches/patch-src_lisp.c:1.1
--- /dev/null   Tue Sep 30 14:29:18 2025
+++ pkgsrc/lang/librep/patches/patch-src_lisp.c Tue Sep 30 14:29:17 2025
@@ -0,0 +1,58 @@
+$NetBSD: patch-src_lisp.c,v 1.1 2025/09/30 14:29:17 gutteridge Exp $
+
+Use ctype.h correctly.
+
+--- src/lisp.c.orig    2017-08-25 19:59:05.000000000 +0000
++++ src/lisp.c
+@@ -639,7 +639,7 @@ read_symbol(repv strm, int *c_p, repv ob
+                           {
+                               radix = 0;
+                           }
+-                          else if(radix == 16 && !isxdigit(c))
++                          else if(radix == 16 && !isxdigit((unsigned char)c))
+                               radix = 0;
+                       }
+                   }
+@@ -1007,20 +1007,20 @@ readl(repv strm, register int *c_p, repv
+                   if (c == EOF)
+                       return signal_reader_error (Qpremature_end_of_stream,
+                                                   strm, "During #\\ syntax");
+-                  if (!isalpha (c))
++                  if (!isalpha ((unsigned char)c))
+                   {
+                       *c_p = rep_stream_getc (strm);
+                       return rep_MAKE_INT (c);
+                   }
+                   c2 = rep_stream_getc (strm);
+-                  if (!isalpha (c2) || c2 == EOF)
++                  if (!isalpha ((unsigned char)c2) || c2 == EOF)
+                   {
+                       *c_p = c2;
+                       return rep_MAKE_INT (c);
+                   }
+ 
+-                  c = tolower (c);
+-                  c2 = tolower (c2);
++                  c = tolower ((unsigned char)c);
++                  c2 = tolower ((unsigned char)c2);
+                   for (i = 0; char_names[i].name != 0; i++)
+                   {
+                       if (char_names[i].name[0] == c
+@@ -1035,7 +1035,7 @@ readl(repv strm, register int *c_p, repv
+                                   *c_p = c;
+                                   return rep_MAKE_INT (char_names[i].value);
+                               }
+-                              if (c == EOF || tolower (c) != *ptr++)
++                              if (c == EOF || tolower ((unsigned char)c) != *ptr++)
+                                   return signal_reader_error (Qinvalid_read_syntax, strm, "Unknown character name");
+                           }
+                       }
+@@ -1075,7 +1075,7 @@ readl(repv strm, register int *c_p, repv
+ 
+           case 't': case 'T':
+           case 'f': case 'F':
+-              form = (tolower (*c_p) == 't') ? rep_scm_t : rep_scm_f;
++              form = (tolower ((unsigned char)*c_p) == 't') ? rep_scm_t : rep_scm_f;
+               *c_p = rep_stream_getc (strm);
+               return form;
+ 
Index: pkgsrc/lang/librep/patches/patch-src_lispcmds.c
diff -u /dev/null pkgsrc/lang/librep/patches/patch-src_lispcmds.c:1.1
--- /dev/null   Tue Sep 30 14:29:18 2025
+++ pkgsrc/lang/librep/patches/patch-src_lispcmds.c     Tue Sep 30 14:29:17 2025
@@ -0,0 +1,26 @@
+$NetBSD: patch-src_lispcmds.c,v 1.1 2025/09/30 14:29:17 gutteridge Exp $
+
+Use ctype.h correctly.
+
+--- src/lispcmds.c.orig        2017-08-25 19:59:05.000000000 +0000
++++ src/lispcmds.c
+@@ -1611,7 +1611,7 @@ Returns t if STRING1 and STRING2 are the
+     s2 = rep_STR(str2);
+     while(*s1 && *s2)
+     {
+-      if (toupper (*s1) != toupper (*s2))
++      if (toupper ((unsigned char)*s1) != toupper ((unsigned char)*s2))
+           return Qnil;
+       s1++; s2++;
+     }
+@@ -1632,8 +1632,8 @@ Returns t if STRING1 is `less' than STRI
+     s2 = rep_STR(str2);
+     while(*s1 && *s2)
+     {
+-      if (toupper (*s1) != toupper (*s2))
+-          return (toupper (*s1) < toupper (*s2)) ? Qt : Qnil;
++      if (toupper ((unsigned char)*s1) != toupper ((unsigned char)*s2))
++          return (toupper ((unsigned char)*s1) < toupper ((unsigned char)*s2)) ? Qt : Qnil;
+       s1++; s2++;
+     }
+     return *s2 ? Qt : Qnil;
Index: pkgsrc/lang/librep/patches/patch-src_misc.c
diff -u /dev/null pkgsrc/lang/librep/patches/patch-src_misc.c:1.1
--- /dev/null   Tue Sep 30 14:29:18 2025
+++ pkgsrc/lang/librep/patches/patch-src_misc.c Tue Sep 30 14:29:17 2025
@@ -0,0 +1,109 @@
+$NetBSD: patch-src_misc.c,v 1.1 2025/09/30 14:29:17 gutteridge Exp $
+
+Use ctype.h correctly.
+
+--- src/misc.c.orig    2017-08-25 19:59:05.000000000 +0000
++++ src/misc.c
+@@ -112,8 +112,8 @@ strncasecmp (const char *s1, const char 
+ 
+   do
+     {
+-      c1 = tolower (*p1++);
+-      c2 = tolower (*p2++);
++      c1 = tolower ((unsigned char)*p1++);
++      c2 = tolower ((unsigned char)*p2++);
+       if (c1 == '\0' || c1 != c2)
+         return c1 - c2;
+     } while (--n > 0);
+@@ -190,7 +190,7 @@ is t, all matching ignores character cas
+                   {
+                       if(rep_NILP(fold)
+                          ? (*tmp2 != *tmp)
+-                         : (tolower(*tmp2) != tolower(*tmp)))
++                         : (tolower((unsigned char)*tmp2) != tolower((unsigned char)*tmp)))
+                       {
+                           break;
+                       }
+@@ -446,7 +446,7 @@ alpha-char-p CHAR
+ Returns t if CHAR is an alphabetic character.
+ ::end:: */
+ {
+-    return (rep_INTP(ch) && isalpha(rep_INT(ch))) ? Qt : Qnil;
++    return (rep_INTP(ch) && isalpha((unsigned char)rep_INT(ch))) ? Qt : Qnil;
+ }
+ 
+ DEFUN("upper-case-p", Fupper_case_p, Supper_case_p, (repv ch), rep_Subr1) /*
+@@ -456,7 +456,7 @@ upper-case-p CHAR
+ Returns t if CHAR is upper case.
+ ::end:: */
+ {
+-    return (rep_INTP(ch) && isupper(rep_INT(ch))) ? Qt : Qnil;
++    return (rep_INTP(ch) && isupper((unsigned char)rep_INT(ch))) ? Qt : Qnil;
+ }
+ 
+ DEFUN("lower-case-p", Flower_case_p, Slower_case_p, (repv ch), rep_Subr1) /*
+@@ -466,7 +466,7 @@ lower-case-p CHAR
+ Returns t if CHAR is lower case.
+ ::end:: */
+ {
+-    return (rep_INTP(ch) && islower(rep_INT(ch))) ? Qt : Qnil;
++    return (rep_INTP(ch) && islower((unsigned char)rep_INT(ch))) ? Qt : Qnil;
+ }
+ 
+ DEFUN("digit-char-p", Fdigit_char_p, Sdigit_char_p, (repv ch), rep_Subr1) /*
+@@ -476,7 +476,7 @@ digit-char-p CHAR
+ Returns t if CHAR is a digit.
+ ::end:: */
+ {
+-    return (rep_INTP(ch) && isdigit(rep_INT(ch))) ? Qt : Qnil;
++    return (rep_INTP(ch) && isdigit((unsigned char)rep_INT(ch))) ? Qt : Qnil;
+ }
+ 
+ DEFUN("alphanumericp", Falphanumericp, Salphanumericp, (repv ch), rep_Subr1) /*
+@@ -486,7 +486,7 @@ alphanumericp CHAR
+ Returns t if CHAR is alpha-numeric.
+ ::end:: */
+ {
+-    return (rep_INTP(ch) && isalnum(rep_INT(ch))) ? Qt : Qnil;
++    return (rep_INTP(ch) && isalnum((unsigned char)rep_INT(ch))) ? Qt : Qnil;
+ }
+ 
+ DEFUN("space-char-p", Fspace_char_p, Sspace_char_p, (repv ch), rep_Subr1) /*
+@@ -496,7 +496,7 @@ space-char-p CHAR
+ Returns t if CHAR is whitespace.
+ ::end:: */
+ {
+-    return (rep_INTP(ch) && isspace(rep_INT(ch))) ? Qt : Qnil;
++    return (rep_INTP(ch) && isspace((unsigned char)rep_INT(ch))) ? Qt : Qnil;
+ }
+ 
+ DEFUN("char-upcase", Fchar_upcase, Schar_upcase, (repv ch), rep_Subr1) /*
+@@ -507,7 +507,7 @@ Returns the upper-case equivalent of CHA
+ ::end:: */
+ {
+     rep_DECLARE1(ch, rep_INTP);
+-    return rep_MAKE_INT(toupper(rep_INT(ch)));
++    return rep_MAKE_INT(toupper((unsigned char)rep_INT(ch)));
+ }
+ 
+ DEFUN("char-downcase", Fchar_downcase, Schar_downcase, (repv ch), rep_Subr1) /*
+@@ -518,7 +518,7 @@ Returns the lower-case equivalent of CHA
+ ::end:: */
+ {
+     rep_DECLARE1(ch, rep_INTP);
+-    return rep_MAKE_INT(tolower(rep_INT(ch)));
++    return rep_MAKE_INT(tolower((unsigned char)rep_INT(ch)));
+ }
+ 
+ DEFUN_INT("system", Fsystem, Ssystem, (repv command), rep_Subr1, "sShell command:") /*
+@@ -648,8 +648,8 @@ rep_misc_init(void)
+ 
+       for(i = 0; i < 256; i++)
+       {
+-          ((unsigned char *)rep_STR(up))[i] = toupper(i);
+-          ((unsigned char *)rep_STR(down))[i] = tolower(i);
++          ((unsigned char *)rep_STR(up))[i] = toupper((unsigned char)i);
++          ((unsigned char *)rep_STR(down))[i] = tolower((unsigned char)i);
+       }
+       rep_STR(up)[256] = 0;
+       rep_STR(down)[256] = 0;
Index: pkgsrc/lang/librep/patches/patch-src_numbers.c
diff -u /dev/null pkgsrc/lang/librep/patches/patch-src_numbers.c:1.1
--- /dev/null   Tue Sep 30 14:29:18 2025
+++ pkgsrc/lang/librep/patches/patch-src_numbers.c      Tue Sep 30 14:29:17 2025
@@ -0,0 +1,24 @@
+$NetBSD: patch-src_numbers.c,v 1.1 2025/09/30 14:29:17 gutteridge Exp $
+
+Use ctype.h correctly.
+
+--- src/numbers.c.orig 2017-08-25 19:59:05.000000000 +0000
++++ src/numbers.c
+@@ -875,7 +875,7 @@ parse_integer_to_float (char *buf, unsig
+     {
+       int d;
+       char c = *buf++;
+-      d = toupper (c) - '0';
++      d = toupper ((unsigned char)c) - '0';
+       if (d < 0 || d >= MAP_SIZE)
+           return rep_FALSE;
+       d = map [d];
+@@ -966,7 +966,7 @@ rep_parse_number (char *buf, unsigned in
+               {
+                   int d;
+                   c = *buf++;
+-                  d = toupper (c) - '0';
++                  d = toupper ((unsigned char)c) - '0';
+                   if (d < 0 || d >= MAP_SIZE)
+                       goto error;
+                   d = map [d];
Index: pkgsrc/lang/librep/patches/patch-src_regexp.c
diff -u /dev/null pkgsrc/lang/librep/patches/patch-src_regexp.c:1.1
--- /dev/null   Tue Sep 30 14:29:18 2025
+++ pkgsrc/lang/librep/patches/patch-src_regexp.c       Tue Sep 30 14:29:17 2025
@@ -0,0 +1,184 @@
+$NetBSD: patch-src_regexp.c,v 1.1 2025/09/30 14:29:17 gutteridge Exp $
+
+Use ctype.h correctly.
+
+--- src/regexp.c.orig  2017-08-25 19:59:05.000000000 +0000
++++ src/regexp.c
+@@ -711,8 +711,8 @@ rep_regexec2(rep_regexp *prog, char *str
+       s = string;
+       if(regnocase)
+       {
+-          mat[0] = tolower(UCHARAT(prog->regmust));
+-          mat[1] = toupper(UCHARAT(prog->regmust));
++          mat[0] = tolower((unsigned char)UCHARAT(prog->regmust));
++          mat[1] = toupper((unsigned char)UCHARAT(prog->regmust));
+           while ((s = strpbrk(s, mat)) != NULL)
+           {
+               if(strncasecmp(s, prog->regmust, prog->regmlen) == 0)
+@@ -748,8 +748,8 @@ rep_regexec2(rep_regexp *prog, char *str
+       /* We know what char it must start with. */
+       if(regnocase)
+       {
+-          mat[0] = tolower(prog->regstart);
+-          mat[1] = toupper(prog->regstart);
++          mat[0] = tolower((unsigned char)prog->regstart);
++          mat[1] = toupper((unsigned char)prog->regstart);
+           while((s = strpbrk(s, mat)) != NULL)
+           {
+               if(regtry(prog, s))
+@@ -892,7 +892,7 @@ regmatch(char *prog)
+               if(regnocase)
+               {
+                   /* Inline the first character, for speed. */
+-                  if(toupper(UCHARAT(opnd)) != toupper(UCHARAT(reginput)))
++                  if(toupper((unsigned char)UCHARAT(opnd)) != toupper((unsigned char)UCHARAT(reginput)))
+                       return (0);
+                   len = strlen(opnd);
+                   if(len > 1 && strncasecmp(opnd, reginput, len) != 0)
+@@ -1011,14 +1011,14 @@ regmatch(char *prog)
+               if (OP(next) == EXACTLY)
+                   nextch = UCHARAT(OPERAND(next));
+               if(regnocase)
+-                  nextch = toupper(nextch);
++                  nextch = toupper((unsigned char)nextch);
+               min = (OP(scan) == STAR) ? 0 : 1;
+               save = reginput;
+               no = regrepeat(OPERAND(scan));
+               while (no >= min) {
+                   /* If it could work, try it. */
+                   if (nextch == '\0'
+-                      || (regnocase ? toupper(UCHARAT(reginput))
++                      || (regnocase ? toupper((unsigned char)UCHARAT(reginput))
+                           : *reginput) == nextch)
+                       if (nested_regmatch(next))
+                           return (1);
+@@ -1044,7 +1044,7 @@ regmatch(char *prog)
+               if (OP(next) == EXACTLY)
+                   nextch = UCHARAT(OPERAND(next));
+               if(regnocase)
+-                  nextch = toupper(nextch);
++                  nextch = toupper((unsigned char)nextch);
+               no = (OP(scan) == NGSTAR) ? 0 : 1;
+               save = reginput;
+               max = regrepeat(OPERAND(scan));
+@@ -1052,7 +1052,7 @@ regmatch(char *prog)
+                   reginput = save + no;
+                   /* If it could work, try it. */
+                   if (nextch == '\0'
+-                      || (regnocase ? toupper(UCHARAT(reginput))
++                      || (regnocase ? toupper((unsigned char)UCHARAT(reginput))
+                           : *reginput) == nextch)
+                       if (nested_regmatch(next))
+                           return (1);
+@@ -1063,49 +1063,49 @@ regmatch(char *prog)
+           }
+           break;
+       case WORD:
+-          if (*reginput != '_' && !isalnum (UCHARAT(reginput)))
++          if (*reginput != '_' && !isalnum ((unsigned char)UCHARAT(reginput)))
+               return 0;
+           reginput++;
+           break;
+       case NWORD:
+-          if (*reginput == '_' || isalnum (UCHARAT(reginput)))
++          if (*reginput == '_' || isalnum ((unsigned char)UCHARAT(reginput)))
+               return 0;
+           reginput++;
+           break;
+       case WSPC:
+-          if (!isspace (UCHARAT(reginput)))
++          if (!isspace ((unsigned char)UCHARAT(reginput)))
+               return 0;
+           reginput++;
+           break;
+       case NWSPC:
+-          if (isspace (UCHARAT(reginput)))
++          if (isspace ((unsigned char)UCHARAT(reginput)))
+               return 0;
+           reginput++;
+           break;
+       case DIGI:
+-          if (!isdigit (UCHARAT(reginput)))
++          if (!isdigit ((unsigned char)UCHARAT(reginput)))
+               return 0;
+           reginput++;
+           break;
+       case NDIGI:
+-          if (isdigit (UCHARAT(reginput)))
++          if (isdigit ((unsigned char)UCHARAT(reginput)))
+               return 0;
+           reginput++;
+           break;
+       case WEDGE:
+           if (reginput == regbol || *reginput == '\0'
+-              || ((reginput[-1] == '_' || isalnum (UCHARAT(reginput - 1)))
+-                  && (*reginput != '_' && !isalnum (UCHARAT(reginput))))
+-              || ((reginput[-1] != '_' && !isalnum (UCHARAT(reginput - 1)))
+-                  && (*reginput == '_' || isalnum (UCHARAT(reginput)))))
++              || ((reginput[-1] == '_' || isalnum ((unsigned char)UCHARAT(reginput - 1)))
++                  && (*reginput != '_' && !isalnum ((unsigned char)UCHARAT(reginput))))
++              || ((reginput[-1] != '_' && !isalnum ((unsigned char)UCHARAT(reginput - 1)))
++                  && (*reginput == '_' || isalnum ((unsigned char)UCHARAT(reginput)))))
+               break;
+           return 0;
+       case NWEDGE:
+           if (!(reginput == regbol || *reginput == '\0'
+-                || ((reginput[-1] == '_' || isalnum (UCHARAT(reginput - 1)))
+-                    && (*reginput != '_' && !isalnum (UCHARAT(reginput))))
+-                || ((reginput[-1] != '_' && !isalnum (UCHARAT(reginput - 1)))
+-                    && (*reginput == '_' || isalnum (UCHARAT(reginput))))))
++                || ((reginput[-1] == '_' || isalnum ((unsigned char)UCHARAT(reginput - 1)))
++                    && (*reginput != '_' && !isalnum ((unsigned char)UCHARAT(reginput))))
++                || ((reginput[-1] != '_' && !isalnum ((unsigned char)UCHARAT(reginput - 1)))
++                    && (*reginput == '_' || isalnum ((unsigned char)UCHARAT(reginput))))))
+               break;
+           return 0;
+       case END:
+@@ -1147,7 +1147,7 @@ regrepeat(char *p)
+     case EXACTLY:
+       if(regnocase)
+       {
+-          while(toupper(UCHARAT(opnd)) == toupper(UCHARAT(scan))) {
++          while(toupper((unsigned char)UCHARAT(opnd)) == toupper((unsigned char)UCHARAT(scan))) {
+               scan++;
+           }
+       }
+@@ -1169,32 +1169,32 @@ regrepeat(char *p)
+       }
+       break;
+     case WORD:
+-      while (*scan != '\0' && (*scan == '_' || isalnum (UCHARAT(scan)))) {
++      while (*scan != '\0' && (*scan == '_' || isalnum ((unsigned char)UCHARAT(scan)))) {
+           scan++;
+       }
+       break;
+     case NWORD:
+-      while (*scan != '\0' && (*scan != '_' && !isalnum (UCHARAT(scan)))) {
++      while (*scan != '\0' && (*scan != '_' && !isalnum ((unsigned char)UCHARAT(scan)))) {
+           scan++;
+       }
+       break;
+     case WSPC:
+-      while (*scan != '\0' && isspace (UCHARAT(scan))) {
++      while (*scan != '\0' && isspace ((unsigned char)UCHARAT(scan))) {
+           scan++;
+       }
+       break;
+     case NWSPC:
+-      while (*scan != '\0' && !isspace (UCHARAT(scan))) {
++      while (*scan != '\0' && !isspace ((unsigned char)UCHARAT(scan))) {
+           scan++;
+       }
+       break;
+     case DIGI:
+-      while (*scan != '\0' && isdigit (UCHARAT(scan))) {
++      while (*scan != '\0' && isdigit ((unsigned char)UCHARAT(scan))) {
+           scan++;
+       }
+       break;
+     case NDIGI:
+-      while (*scan != '\0' && !isdigit (UCHARAT(scan))) {
++      while (*scan != '\0' && !isdigit ((unsigned char)UCHARAT(scan))) {
+           scan++;
+       }
+       break;
Index: pkgsrc/lang/librep/patches/patch-src_streams.c
diff -u /dev/null pkgsrc/lang/librep/patches/patch-src_streams.c:1.1
--- /dev/null   Tue Sep 30 14:29:18 2025
+++ pkgsrc/lang/librep/patches/patch-src_streams.c      Tue Sep 30 14:29:17 2025
@@ -0,0 +1,48 @@
+$NetBSD: patch-src_streams.c,v 1.1 2025/09/30 14:29:17 gutteridge Exp $
+
+Use ctype.h correctly.
+
+--- src/streams.c.orig 2017-08-25 19:59:05.000000000 +0000
++++ src/streams.c
+@@ -479,7 +479,7 @@ rep_stream_read_esc (repv stream, int *c
+       c = '\a';
+       break;
+     case '^':
+-      c = toupper (rep_stream_getc (stream)) ^ 0x40;
++      c = toupper ((unsigned char)rep_stream_getc (stream)) ^ 0x40;
+       break;
+     case '0':
+     case '1':
+@@ -510,12 +510,12 @@ rep_stream_read_esc (repv stream, int *c
+       while (1)
+       {
+           *c_p = rep_stream_getc (stream);
+-          if (!isxdigit (*c_p))
++          if (!isxdigit ((unsigned char)*c_p))
+               return c;
+           if ((*c_p >= '0') && (*c_p <= '9'))
+               c = (c * 16) + (*c_p - '0');
+           else
+-              c = (c * 16) + (toupper (*c_p) - 'A') + 10;
++              c = (c * 16) + (toupper ((unsigned char)*c_p) - 'A') + 10;
+       }
+     default:
+       c = *c_p;
+@@ -971,7 +971,7 @@ Note that the FIELD-WIDTH and all flags 
+ 
+           /* Now look for the field width */
+       parse_field_width:
+-          while(isdigit (c))
++          while(isdigit ((unsigned char)c))
+           {
+               field_width = field_width * 10 + (c - '0');
+               c = *fmt++;
+@@ -981,7 +981,7 @@ Note that the FIELD-WIDTH and all flags 
+           if (c == '.')
+           {
+               c = *fmt++;
+-              while (c && isdigit (c))
++              while (c && isdigit ((unsigned char)c))
+               {
+                   precision = precision * 10 + (c - '0');
+                   c = *fmt++;
Index: pkgsrc/lang/librep/patches/patch-src_symbols.c
diff -u /dev/null pkgsrc/lang/librep/patches/patch-src_symbols.c:1.1
--- /dev/null   Tue Sep 30 14:29:18 2025
+++ pkgsrc/lang/librep/patches/patch-src_symbols.c      Tue Sep 30 14:29:17 2025
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_symbols.c,v 1.1 2025/09/30 14:29:17 gutteridge Exp $
+
+Use ctype.h correctly.
+
+--- src/symbols.c.orig 2017-08-25 19:59:05.000000000 +0000
++++ src/symbols.c
+@@ -207,7 +207,7 @@ symbol_print(repv strm, repv obj)
+           break;
+ 
+       default:
+-          if (iscntrl (c))
++          if (iscntrl ((unsigned char)c))
+               *out++ = '\\';
+           break;
+       }



Home | Main Index | Thread Index | Old Index