pkgsrc-Changes archive

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

CVS commit: pkgsrc/lang/erlang



Module Name:    pkgsrc
Committed By:   riastradh
Date:           Mon May 27 19:07:50 UTC 2024

Modified Files:
        pkgsrc/lang/erlang: Makefile distinfo
        pkgsrc/lang/erlang/patches:
            patch-erts_emulator_drivers_common_inet__drv.c
Added Files:
        pkgsrc/lang/erlang/patches: patch-erts_emulator_beam_erl__init.c
            patch-erts_emulator_beam_packet__parser.c
            patch-erts_emulator_drivers_common_ram__file__drv.c
            patch-erts_emulator_drivers_win32_registry__drv.c
            patch-erts_emulator_nifs_common_prim__tty__nif.c
            patch-erts_emulator_sys_unix_sys.c patch-erts_etc_common_dialyzer.c
            patch-erts_etc_common_erlc.c patch-erts_etc_common_typer.c
            patch-erts_etc_unix_setuid__socket__wrap.c
            patch-erts_lib__src_common_erl__printf__format.c
            patch-erts_lib__src_pthread_ethread.c
            patch-lib_erl__interface_src_misc_ei__format.c
            patch-lib_erl__interface_src_misc_ei__printterm.c
            patch-lib_erl__interface_src_prog_erl__call.c
            patch-lib_inets_test_inets__socketwrap__SUITE__data_setuid__socket__wrap.c
            patch-lib_megaco_src_flex_megaco__flex__scanner__drv.flex.src
            patch-lib_odbc_c__src_odbcserver.c

Log Message:
lang/erlang: Fix ctype(3) misuse.


To generate a diff of this commit:
cvs rdiff -u -r1.122 -r1.123 pkgsrc/lang/erlang/Makefile
cvs rdiff -u -r1.113 -r1.114 pkgsrc/lang/erlang/distinfo
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/lang/erlang/patches/patch-erts_emulator_beam_erl__init.c \
    pkgsrc/lang/erlang/patches/patch-erts_emulator_beam_packet__parser.c \
    pkgsrc/lang/erlang/patches/patch-erts_emulator_drivers_common_ram__file__drv.c \
    pkgsrc/lang/erlang/patches/patch-erts_emulator_drivers_win32_registry__drv.c \
    pkgsrc/lang/erlang/patches/patch-erts_emulator_nifs_common_prim__tty__nif.c \
    pkgsrc/lang/erlang/patches/patch-erts_etc_common_dialyzer.c \
    pkgsrc/lang/erlang/patches/patch-erts_etc_common_erlc.c \
    pkgsrc/lang/erlang/patches/patch-erts_etc_common_typer.c \
    pkgsrc/lang/erlang/patches/patch-erts_etc_unix_setuid__socket__wrap.c \
    pkgsrc/lang/erlang/patches/patch-erts_lib__src_common_erl__printf__format.c \
    pkgsrc/lang/erlang/patches/patch-erts_lib__src_pthread_ethread.c \
    pkgsrc/lang/erlang/patches/patch-lib_erl__interface_src_misc_ei__format.c \
    pkgsrc/lang/erlang/patches/patch-lib_erl__interface_src_misc_ei__printterm.c \
    pkgsrc/lang/erlang/patches/patch-lib_erl__interface_src_prog_erl__call.c \
    pkgsrc/lang/erlang/patches/patch-lib_inets_test_inets__socketwrap__SUITE__data_setuid__socket__wrap.c \
    pkgsrc/lang/erlang/patches/patch-lib_megaco_src_flex_megaco__flex__scanner__drv.flex.src \
    pkgsrc/lang/erlang/patches/patch-lib_odbc_c__src_odbcserver.c
cvs rdiff -u -r1.5 -r1.6 \
    pkgsrc/lang/erlang/patches/patch-erts_emulator_drivers_common_inet__drv.c
cvs rdiff -u -r0 -r1.3 \
    pkgsrc/lang/erlang/patches/patch-erts_emulator_sys_unix_sys.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/erlang/Makefile
diff -u pkgsrc/lang/erlang/Makefile:1.122 pkgsrc/lang/erlang/Makefile:1.123
--- pkgsrc/lang/erlang/Makefile:1.122   Mon May 27 16:19:18 2024
+++ pkgsrc/lang/erlang/Makefile Mon May 27 19:07:50 2024
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.122 2024/05/27 16:19:18 riastradh Exp $
+# $NetBSD: Makefile,v 1.123 2024/05/27 19:07:50 riastradh Exp $
 
 DISTNAME=      erlang-${DIST_VERSION_MAJOR}.${DIST_VERSION_MINOR}${!empty(DIST_VERSION_PATCH):?.:}${DIST_VERSION_PATCH}
 PKGNAME=       ${DISTNAME:S/OTP-/erlang-/}
-PKGREVISION=   1
+PKGREVISION=   2
 CATEGORIES=    lang
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=erlang/}
 GITHUB_PROJECT=        otp

Index: pkgsrc/lang/erlang/distinfo
diff -u pkgsrc/lang/erlang/distinfo:1.113 pkgsrc/lang/erlang/distinfo:1.114
--- pkgsrc/lang/erlang/distinfo:1.113   Mon May  6 06:52:50 2024
+++ pkgsrc/lang/erlang/distinfo Mon May 27 19:07:50 2024
@@ -1,18 +1,36 @@
-$NetBSD: distinfo,v 1.113 2024/05/06 06:52:50 wiz Exp $
+$NetBSD: distinfo,v 1.114 2024/05/27 19:07:50 riastradh Exp $
 
 BLAKE2s (erlang-26.2.5.tar.gz) = f846568c846c62db184fc50e30b16e22716a869ea0632f934294dd8f7bb2b821
 SHA512 (erlang-26.2.5.tar.gz) = f06d34290c0d93609aa3efbdc97206e8d3ce17aa2c3f62b6c566c7631ee3a3d45a89b61ce0ace81604b5a94610d03ad98558f27ee888ca90ecdeeeb2759c0184
 Size (erlang-26.2.5.tar.gz) = 62479032 bytes
 SHA1 (patch-erts_emulator_Makefile.in) = b99ccd2669652b1542b2ee99e09f886d864fd8be
-SHA1 (patch-erts_emulator_drivers_common_inet__drv.c) = dbe72306aac6be0cec09f45869ff077f1bab1e68
+SHA1 (patch-erts_emulator_beam_erl__init.c) = ccbf4330a0774b97a3aca611fc57ba60062e1390
+SHA1 (patch-erts_emulator_beam_packet__parser.c) = 13cb7fb1d65ddac93221d85df1a44d76332b1cec
+SHA1 (patch-erts_emulator_drivers_common_inet__drv.c) = 937280446342ceb00e3d193fe0e2ee47765a9957
+SHA1 (patch-erts_emulator_drivers_common_ram__file__drv.c) = 5c3c05c27b2eec0f5be1e31f2e8fbdee0d9b8885
+SHA1 (patch-erts_emulator_drivers_win32_registry__drv.c) = 5d66b9be1c09f7c471d9675f376df3c8ec3d39be
+SHA1 (patch-erts_emulator_nifs_common_prim__tty__nif.c) = 10843ede3abd4a6c68fa60cbc3e5b434cfc19e31
 SHA1 (patch-erts_emulator_nifs_unix_unix__socket__syncio.c) = 6bad5f82ca72c46d3b8e4e0c5a4a7622ff85d3bf
+SHA1 (patch-erts_emulator_sys_unix_sys.c) = 47c96638408b0a75546114931316181fd3f57909
 SHA1 (patch-erts_emulator_sys_unix_sys__uds.c) = ee131143c177b2bc1453d94097cbf6b3d3cfb899
+SHA1 (patch-erts_etc_common_dialyzer.c) = abeb5377dcb1a438ded5e7013e9f3664e35c9ddb
+SHA1 (patch-erts_etc_common_erlc.c) = 8f15065389b3b16448095888c4a3575f73d2253b
+SHA1 (patch-erts_etc_common_typer.c) = 43b6ad1fa6e4e4be4a08463d13170a47c1098039
 SHA1 (patch-erts_etc_unix_run__erl.c) = b888aaed44cab4eea87474f7f02adba1f904e033
+SHA1 (patch-erts_etc_unix_setuid__socket__wrap.c) = ceb1466192b31c27453e80454f5cf15a9c368909
 SHA1 (patch-erts_lib__src_common_erl__printf.c) = e156722b0617a4a9eb1eb7ea63365cb52ff2e2c9
+SHA1 (patch-erts_lib__src_common_erl__printf__format.c) = 2d5b98a5450c36b0eda4e2161ac3aefa6c08f6bc
+SHA1 (patch-erts_lib__src_pthread_ethread.c) = d4c6e55818061ac465cc022e748cd072abbc2825
 SHA1 (patch-lib_asn1_c__src_Makefile) = d47870e58de5e10a94dfa9f4a274c88261633e5b
 SHA1 (patch-lib_crypto_c__src_Makefile.in) = 025efecaa05f8a190a9024c475cbe5e9ab9286d9
+SHA1 (patch-lib_erl__interface_src_misc_ei__format.c) = 255ad04bd60e1aefe6668f1c6fcefc790d0564df
+SHA1 (patch-lib_erl__interface_src_misc_ei__printterm.c) = 587f17c256c62aa29fda7d36d8056875b4b4193f
+SHA1 (patch-lib_erl__interface_src_prog_erl__call.c) = 3d585d4dbb2a45e1d177b9417fba0c261e5de3fd
+SHA1 (patch-lib_inets_test_inets__socketwrap__SUITE__data_setuid__socket__wrap.c) = d2e0f9f439f641fda53f7226f787678e04ae59d6
 SHA1 (patch-lib_megaco_src_flex_Makefile.in) = 06eb5a76cc2e5adb4294c7db6919bb7c083c425c
+SHA1 (patch-lib_megaco_src_flex_megaco__flex__scanner__drv.flex.src) = de57f4a94cdce3782592b4767a731b3693ba0224
 SHA1 (patch-lib_odbc_c__src_Makefile.in) = 21dc0a123ae0d6f8e86f3fb9ffaf66e26361172b
+SHA1 (patch-lib_odbc_c__src_odbcserver.c) = 59960575f8ea8f6e65b2ad1f89632d48d40e2cfd
 SHA1 (patch-lib_runtime__tools_c__src_Makefile.in) = 98d351192902d5f6d3bd506c6e382caa06642383
 SHA1 (patch-make_otp.mk.in) = 9d1e33ab3660b5cf0faa2b74129158b71aae408f
 SHA1 (patch-make_output.mk.in) = d7b3da58bfb471d52c41242e2a03d1598ce24e62

Index: pkgsrc/lang/erlang/patches/patch-erts_emulator_drivers_common_inet__drv.c
diff -u pkgsrc/lang/erlang/patches/patch-erts_emulator_drivers_common_inet__drv.c:1.5 pkgsrc/lang/erlang/patches/patch-erts_emulator_drivers_common_inet__drv.c:1.6
--- pkgsrc/lang/erlang/patches/patch-erts_emulator_drivers_common_inet__drv.c:1.5       Sat Oct 15 18:04:10 2022
+++ pkgsrc/lang/erlang/patches/patch-erts_emulator_drivers_common_inet__drv.c   Mon May 27 19:07:50 2024
@@ -1,10 +1,24 @@
-$NetBSD: patch-erts_emulator_drivers_common_inet__drv.c,v 1.5 2022/10/15 18:04:10 triaxx Exp $
+$NetBSD: patch-erts_emulator_drivers_common_inet__drv.c,v 1.6 2024/05/27 19:07:50 riastradh Exp $
+
+Fix ctype(3) misuse.
 
 Unbreak build due to differences in the NetBSD SCTP implementation.
 
---- erts/emulator/drivers/common/inet_drv.c.orig       2018-09-24 10:32:43.000000000 +0100
-+++ erts/emulator/drivers/common/inet_drv.c    2018-11-09 09:34:01.671317341 +0000
-@@ -1315,7 +1315,11 @@
+--- erts/emulator/drivers/common/inet_drv.c.orig       2024-03-06 15:30:18.000000000 +0000
++++ erts/emulator/drivers/common/inet_drv.c
+@@ -591,9 +591,9 @@ static int my_strncasecmp(const char *s1
+ {
+     int i;
+ 
+-    for (i=0;i<n-1 && s1[i] && s2[i] && toupper(s1[i]) == toupper(s2[i]);++i)
++    for (i=0;i<n-1 && s1[i] && s2[i] && toupper((unsigned char)s1[i]) == toupper((unsigned char)s2[i]);++i)
+       ;
+-    return (toupper(s1[i]) - toupper(s2[i]));
++    return (toupper((unsigned char)s1[i]) - toupper((unsigned char)s2[i]));
+ }
+       
+ 
+@@ -1331,7 +1331,11 @@ static struct erl_drv_entry tcp_inet_dri
      inet_emergency_close
  };
  

Added files:

Index: pkgsrc/lang/erlang/patches/patch-erts_emulator_beam_erl__init.c
diff -u /dev/null pkgsrc/lang/erlang/patches/patch-erts_emulator_beam_erl__init.c:1.1
--- /dev/null   Mon May 27 19:07:50 2024
+++ pkgsrc/lang/erlang/patches/patch-erts_emulator_beam_erl__init.c     Mon May 27 19:07:50 2024
@@ -0,0 +1,15 @@
+$NetBSD: patch-erts_emulator_beam_erl__init.c,v 1.1 2024/05/27 19:07:50 riastradh Exp $
+
+Fix ctype(3) misuse.
+
+--- erts/emulator/beam/erl_init.c.orig 2024-03-06 15:30:18.000000000 +0000
++++ erts/emulator/beam/erl_init.c
+@@ -262,7 +262,7 @@ this_rel_num(void)
+       char this_rel_str[] = ERLANG_OTP_RELEASE;
+           
+       i = 0;
+-      while (this_rel_str[i] && !isdigit((int) this_rel_str[i]))
++      while (this_rel_str[i] && !isdigit((unsigned char) this_rel_str[i]))
+           i++;
+       this_rel = atoi(&this_rel_str[i]); 
+       if (this_rel < 1)
Index: pkgsrc/lang/erlang/patches/patch-erts_emulator_beam_packet__parser.c
diff -u /dev/null pkgsrc/lang/erlang/patches/patch-erts_emulator_beam_packet__parser.c:1.1
--- /dev/null   Mon May 27 19:07:50 2024
+++ pkgsrc/lang/erlang/patches/patch-erts_emulator_beam_packet__parser.c        Mon May 27 19:07:50 2024
@@ -0,0 +1,100 @@
+$NetBSD: patch-erts_emulator_beam_packet__parser.c,v 1.1 2024/05/27 19:07:50 riastradh Exp $
+
+Fix ctype(3) misuse.
+
+--- erts/emulator/beam/packet_parser.c.orig    2024-03-06 15:30:18.000000000 +0000
++++ erts/emulator/beam/packet_parser.c
+@@ -46,9 +46,9 @@ static int my_strncasecmp(const char *s1
+ {
+     int i;
+ 
+-    for (i=0;i<n-1 && s1[i] && s2[i] && toupper(s1[i]) == toupper(s2[i]);++i)
++    for (i=0;i<n-1 && s1[i] && s2[i] && toupper((unsigned char)s1[i]) == toupper((unsigned char)s2[i]);++i)
+       ;
+-    return (toupper(s1[i]) - toupper(s2[i]));
++    return (toupper((unsigned char)s1[i]) - toupper((unsigned char)s2[i]));
+ }
+       
+ 
+@@ -551,7 +551,7 @@ http_parse_absoluteURI(PacketHttpURI* ur
+       if (sys_memrchr(uri_ptr, ':', uri_len) == v + 1) {
+         // Skip over `]:`
+         v = v + 2;
+-        while(n && isdigit((int) *v)) {
++        while(n && isdigit((unsigned char) *v)) {
+             port = port*10 + (*v - '0');
+             n--;
+             v++;
+@@ -568,7 +568,7 @@ http_parse_absoluteURI(PacketHttpURI* ur
+         n = uri_len - (n+1);
+         // Skip over port delimiter `:`
+         p++;
+-        while(n && isdigit((int) *p)) {
++        while(n && isdigit((unsigned char) *p)) {
+             port = port*10 + (*p - '0');
+             n--;
+             p++;
+@@ -684,7 +684,7 @@ int packet_parse_http(const char* buf, i
+             ptr += 5;
+             n -= 5;
+             p0 = ptr;
+-            while (n && isdigit((int) *ptr)) {
++            while (n && isdigit((unsigned char) *ptr)) {
+                 major = 10*major + (*ptr - '0');
+                 ptr++;
+                 n--;
+@@ -694,7 +694,7 @@ int packet_parse_http(const char* buf, i
+             ptr++;
+             n--;
+             p0 = ptr;
+-            while (n && isdigit((int) *ptr)) {
++            while (n && isdigit((unsigned char) *ptr)) {
+                 minor = 10*minor + (*ptr - '0');
+                 ptr++;
+                 n--;
+@@ -706,7 +706,7 @@ int packet_parse_http(const char* buf, i
+             }
+             if (ptr==p0) return -1;
+             
+-            while (n && isdigit((int) *ptr)) {
++            while (n && isdigit((unsigned char) *ptr)) {
+                 status = 10*status + (*ptr - '0');
+                 ptr++;
+                 n--;
+@@ -772,7 +772,7 @@ int packet_parse_http(const char* buf, i
+             n   -= 5;
+ 
+             p0 = ptr;
+-            while (n && isdigit((int) *ptr)) {
++            while (n && isdigit((unsigned char) *ptr)) {
+                 major = 10*major + (*ptr - '0');
+                 ptr++;
+                 n--;
+@@ -782,7 +782,7 @@ int packet_parse_http(const char* buf, i
+             ptr++;
+             n--;
+             p0 = ptr;
+-            while (n && isdigit((int) *ptr)) {
++            while (n && isdigit((unsigned char) *ptr)) {
+                 minor = 10*minor + (*ptr - '0');
+                 ptr++;
+                 n--;
+@@ -814,14 +814,14 @@ int packet_parse_http(const char* buf, i
+             if (name_len < HTTP_MAX_NAME_LEN) {
+                 int c = *ptr;
+                 if (up) {
+-                    if (islower(c)) {
+-                        c = toupper(c);
++                    if (islower((unsigned char)c)) {
++                        c = toupper((unsigned char)c);
+                     }
+                     up = 0;
+                 }
+                 else {
+-                    if (isupper(c))
+-                        c = tolower(c);
++                    if (isupper((unsigned char)c))
++                        c = tolower((unsigned char)c);
+                     else if (c == '-')
+                         up = 1;
+                 }                            
Index: pkgsrc/lang/erlang/patches/patch-erts_emulator_drivers_common_ram__file__drv.c
diff -u /dev/null pkgsrc/lang/erlang/patches/patch-erts_emulator_drivers_common_ram__file__drv.c:1.1
--- /dev/null   Mon May 27 19:07:50 2024
+++ pkgsrc/lang/erlang/patches/patch-erts_emulator_drivers_common_ram__file__drv.c      Mon May 27 19:07:50 2024
@@ -0,0 +1,15 @@
+$NetBSD: patch-erts_emulator_drivers_common_ram__file__drv.c,v 1.1 2024/05/27 19:07:50 riastradh Exp $
+
+Fix ctype(3) misuse.
+
+--- erts/emulator/drivers/common/ram_file_drv.c.orig   2024-03-06 15:30:18.000000000 +0000
++++ erts/emulator/drivers/common/ram_file_drv.c
+@@ -211,7 +211,7 @@ static int error_reply(RamFile *f, int e
+      */
+     response[0] = RAM_FILE_RESP_ERROR;
+     for (s = erl_errno_id(err), t = response+1; *s; s++, t++)
+-      *t = tolower(*s);
++      *t = tolower((unsigned char)*s);
+     driver_output2(f->port, response, t-response, NULL, 0);
+     return 0;
+ }
Index: pkgsrc/lang/erlang/patches/patch-erts_emulator_drivers_win32_registry__drv.c
diff -u /dev/null pkgsrc/lang/erlang/patches/patch-erts_emulator_drivers_win32_registry__drv.c:1.1
--- /dev/null   Mon May 27 19:07:50 2024
+++ pkgsrc/lang/erlang/patches/patch-erts_emulator_drivers_win32_registry__drv.c        Mon May 27 19:07:50 2024
@@ -0,0 +1,24 @@
+$NetBSD: patch-erts_emulator_drivers_win32_registry__drv.c,v 1.1 2024/05/27 19:07:50 riastradh Exp $
+
+Fix ctype(3) misuse.
+
+--- erts/emulator/drivers/win32/registry_drv.c.orig    2024-03-06 15:30:18.000000000 +0000
++++ erts/emulator/drivers/win32/registry_drv.c
+@@ -128,7 +128,7 @@ reg_start(ErlDrvPort port, char* buf)
+     REGSAM sam = KEY_READ;
+ 
+     if ((s = strchr(buf, ' ')) != NULL) {
+-      while (isspace(*s))
++      while (isspace((unsigned char)*s))
+           s++;
+       while (*s != '\0') {
+           if (*s == 'r') {
+@@ -417,7 +417,7 @@ reply(RegPort* rp, LONG result)
+       sbuf[0] = 'e';
+       err = maperror(result);
+       for (s = erl_errno_id(err), t = sbuf+1; *s; s++, t++) {
+-          *t = tolower(*s);
++          *t = tolower((unsigned char)*s);
+       }
+       driver_output(rp->port, sbuf, t-sbuf);
+     }
Index: pkgsrc/lang/erlang/patches/patch-erts_emulator_nifs_common_prim__tty__nif.c
diff -u /dev/null pkgsrc/lang/erlang/patches/patch-erts_emulator_nifs_common_prim__tty__nif.c:1.1
--- /dev/null   Mon May 27 19:07:50 2024
+++ pkgsrc/lang/erlang/patches/patch-erts_emulator_nifs_common_prim__tty__nif.c Mon May 27 19:07:50 2024
@@ -0,0 +1,15 @@
+$NetBSD: patch-erts_emulator_nifs_common_prim__tty__nif.c,v 1.1 2024/05/27 19:07:50 riastradh Exp $
+
+Fix ctype(3) misuse.
+
+--- erts/emulator/nifs/common/prim_tty_nif.c.orig      2024-03-06 15:30:18.000000000 +0000
++++ erts/emulator/nifs/common/prim_tty_nif.c
+@@ -266,7 +266,7 @@ static ERL_NIF_TERM isprint_nif(ErlNifEn
+     int i;
+     if (enif_get_int(env, argv[0], &i)) {
+         ASSERT(i > 0 && i < 256);
+-        return isprint((char)i) ? atom_true : atom_false;
++        return isprint((unsigned char)i) ? atom_true : atom_false;
+     }
+     return enif_make_badarg(env);
+ }
Index: pkgsrc/lang/erlang/patches/patch-erts_etc_common_dialyzer.c
diff -u /dev/null pkgsrc/lang/erlang/patches/patch-erts_etc_common_dialyzer.c:1.1
--- /dev/null   Mon May 27 19:07:50 2024
+++ pkgsrc/lang/erlang/patches/patch-erts_etc_common_dialyzer.c Mon May 27 19:07:50 2024
@@ -0,0 +1,22 @@
+$NetBSD: patch-erts_etc_common_dialyzer.c,v 1.1 2024/05/27 19:07:50 riastradh Exp $
+
+Fix ctype(3) misuse.
+
+--- erts/etc/common/dialyzer.c.orig    2024-03-06 15:30:18.000000000 +0000
++++ erts/etc/common/dialyzer.c
+@@ -297,13 +297,13 @@ push_words(char* src)
+ 
+     dst = sbuf;
+     while ((*dst++ = *src++) != '\0') {
+-      if (isspace((int)*src)) {
++      if (isspace((unsigned char)*src)) {
+           *dst = '\0';
+           PUSH(strsave(sbuf));
+           dst = sbuf;
+           do {
+               src++;
+-          } while (isspace((int)*src));
++          } while (isspace((unsigned char)*src));
+       }
+     }
+     if (sbuf[0])
Index: pkgsrc/lang/erlang/patches/patch-erts_etc_common_erlc.c
diff -u /dev/null pkgsrc/lang/erlang/patches/patch-erts_etc_common_erlc.c:1.1
--- /dev/null   Mon May 27 19:07:50 2024
+++ pkgsrc/lang/erlang/patches/patch-erts_etc_common_erlc.c     Mon May 27 19:07:50 2024
@@ -0,0 +1,22 @@
+$NetBSD: patch-erts_etc_common_erlc.c,v 1.1 2024/05/27 19:07:50 riastradh Exp $
+
+Fix ctype(3) misuse.
+
+--- erts/etc/common/erlc.c.orig        2024-03-06 15:30:18.000000000 +0000
++++ erts/etc/common/erlc.c
+@@ -479,13 +479,13 @@ push_words(char* src)
+ 
+     dst = sbuf;
+     while ((*dst++ = *src++) != '\0') {
+-      if (isspace((int)*src)) {
++      if (isspace((unsigned char)*src)) {
+           *dst = '\0';
+           PUSH(strsave(sbuf));
+           dst = sbuf;
+           do {
+               src++;
+-          } while (isspace((int)*src));
++          } while (isspace((unsigned char)*src));
+       }
+     }
+     if (sbuf[0])
Index: pkgsrc/lang/erlang/patches/patch-erts_etc_common_typer.c
diff -u /dev/null pkgsrc/lang/erlang/patches/patch-erts_etc_common_typer.c:1.1
--- /dev/null   Mon May 27 19:07:50 2024
+++ pkgsrc/lang/erlang/patches/patch-erts_etc_common_typer.c    Mon May 27 19:07:50 2024
@@ -0,0 +1,22 @@
+$NetBSD: patch-erts_etc_common_typer.c,v 1.1 2024/05/27 19:07:50 riastradh Exp $
+
+Fix ctype(3) misuse.
+
+--- erts/etc/common/typer.c.orig       2024-03-06 15:30:18.000000000 +0000
++++ erts/etc/common/typer.c
+@@ -224,13 +224,13 @@ push_words(char* src)
+ 
+     dst = sbuf;
+     while ((*dst++ = *src++) != '\0') {
+-      if (isspace((int)*src)) {
++      if (isspace((unsigned char)*src)) {
+           *dst = '\0';
+           PUSH(strsave(sbuf));
+           dst = sbuf;
+           do {
+               src++;
+-          } while (isspace((int)*src));
++          } while (isspace((unsigned char)*src));
+       }
+     }
+     if (sbuf[0])
Index: pkgsrc/lang/erlang/patches/patch-erts_etc_unix_setuid__socket__wrap.c
diff -u /dev/null pkgsrc/lang/erlang/patches/patch-erts_etc_unix_setuid__socket__wrap.c:1.1
--- /dev/null   Mon May 27 19:07:50 2024
+++ pkgsrc/lang/erlang/patches/patch-erts_etc_unix_setuid__socket__wrap.c       Mon May 27 19:07:50 2024
@@ -0,0 +1,15 @@
+$NetBSD: patch-erts_etc_unix_setuid__socket__wrap.c,v 1.1 2024/05/27 19:07:50 riastradh Exp $
+
+Fix ctype(3) misuse.
+
+--- erts/etc/unix/setuid_socket_wrap.c.orig    2024-03-06 15:30:18.000000000 +0000
++++ erts/etc/unix/setuid_socket_wrap.c
+@@ -70,7 +70,7 @@ int parse_addr(addr, str)
+     if ((cp = strrchr(str, (int)':')) != NULL)
+         *cp++ = '\0';
+     if (cp) {
+-        if (!isdigit((int)cp[0])) {
++        if (!isdigit((unsigned char)cp[0])) {
+             if ((se = getservbyname(cp, "tcp")) != NULL) {
+                 port = ntohs(se->s_port);
+           } else {
Index: pkgsrc/lang/erlang/patches/patch-erts_lib__src_common_erl__printf__format.c
diff -u /dev/null pkgsrc/lang/erlang/patches/patch-erts_lib__src_common_erl__printf__format.c:1.1
--- /dev/null   Mon May 27 19:07:50 2024
+++ pkgsrc/lang/erlang/patches/patch-erts_lib__src_common_erl__printf__format.c Mon May 27 19:07:50 2024
@@ -0,0 +1,39 @@
+$NetBSD: patch-erts_lib__src_common_erl__printf__format.c,v 1.1 2024/05/27 19:07:50 riastradh Exp $
+
+Fix ctype(3) misuse.
+
+--- erts/lib_src/common/erl_printf_format.c.orig       2024-03-06 15:30:18.000000000 +0000
++++ erts/lib_src/common/erl_printf_format.c
+@@ -480,9 +480,9 @@ int erts_printf_format(fmtfn_t fn, void*
+               width = va_arg(ap, int);
+               ptr++;
+           }
+-          else if (isdigit((int) *ptr)) {
++          else if (isdigit((unsigned char) *ptr)) {
+               width = *ptr++ - '0';
+-              while(isdigit((int) *ptr))
++              while(isdigit((unsigned char) *ptr))
+                   width = 10*width + (*ptr++ - '0');
+           }
+ 
+@@ -493,9 +493,9 @@ int erts_printf_format(fmtfn_t fn, void*
+                   precision = va_arg(ap, int);
+                   ptr++;
+               }
+-              else if (isdigit((int) *ptr)) {
++              else if (isdigit((unsigned char) *ptr)) {
+                   precision = *ptr++ - '0';
+-                  while(isdigit((int) *ptr))
++                  while(isdigit((unsigned char) *ptr))
+                       precision = 10*precision + (*ptr++ - '0');
+               }
+           }
+@@ -528,7 +528,7 @@ int erts_printf_format(fmtfn_t fn, void*
+               }
+               else {
+                   int bits = 0;
+-                  while(isdigit((int) *ptr))
++                  while(isdigit((unsigned char) *ptr))
+                       bits = 10*bits + (*ptr++ - '0');
+                   switch (bits) {
+                   case 64:
Index: pkgsrc/lang/erlang/patches/patch-erts_lib__src_pthread_ethread.c
diff -u /dev/null pkgsrc/lang/erlang/patches/patch-erts_lib__src_pthread_ethread.c:1.1
--- /dev/null   Mon May 27 19:07:50 2024
+++ pkgsrc/lang/erlang/patches/patch-erts_lib__src_pthread_ethread.c    Mon May 27 19:07:50 2024
@@ -0,0 +1,30 @@
+$NetBSD: patch-erts_lib__src_pthread_ethread.c,v 1.1 2024/05/27 19:07:50 riastradh Exp $
+
+Fix ctype(3) misuse.
+
+--- erts/lib_src/pthread/ethread.c.orig        2024-03-06 15:30:18.000000000 +0000
++++ erts/lib_src/pthread/ethread.c
+@@ -765,19 +765,19 @@ init_get_monotonic_time(void)
+     (void) uname(&uts);
+     
+     for (c = uts.sysname; *c; c++) {
+-      if (isupper((int) *c))
+-          *c = tolower((int) *c);
++      if (isupper((unsigned char) *c))
++          *c = tolower((unsigned char) *c);
+     }
+ 
+     c = uts.release;
+     for (i = 0; i < sizeof(vsn)/sizeof(int); i++) {
+-      if (!isdigit((int) *c))
++      if (!isdigit((unsigned char) *c))
+           vsn[i] = 0;
+       else {
+           char *c2 = c;
+           do {
+               c2++;
+-          } while (isdigit((int) *c2));
++          } while (isdigit((unsigned char) *c2));
+           *c2 = '\0';
+           vsn[i] = atoi(c);
+           c = c2;
Index: pkgsrc/lang/erlang/patches/patch-lib_erl__interface_src_misc_ei__format.c
diff -u /dev/null pkgsrc/lang/erlang/patches/patch-lib_erl__interface_src_misc_ei__format.c:1.1
--- /dev/null   Mon May 27 19:07:50 2024
+++ pkgsrc/lang/erlang/patches/patch-lib_erl__interface_src_misc_ei__format.c   Mon May 27 19:07:50 2024
@@ -0,0 +1,111 @@
+$NetBSD: patch-lib_erl__interface_src_misc_ei__format.c,v 1.1 2024/05/27 19:07:50 riastradh Exp $
+
+Fix ctype(3) misuse.
+
+--- lib/erl_interface/src/misc/ei_format.c.orig        2024-05-02 13:07:57.000000000 +0000
++++ lib/erl_interface/src/misc/ei_format.c
+@@ -71,7 +71,7 @@ static int eiformat(const char** fmt, un
+     int res;
+     ei_x_buff x2;
+ 
+-    while (isspace((int)*p))
++    while (isspace((unsigned char)*p))
+       ++p;
+     switch (*p) {
+     case '~':
+@@ -117,11 +117,11 @@ static int eiformat(const char** fmt, un
+           break;
+       }
+     default:
+-      if (isdigit((int)*p))
++      if (isdigit((unsigned char)*p))
+           res = pdigit(&p, x);
+-      else if ((*p == '-' || *p == '+') && isdigit((int)*(p+1)))
++      else if ((*p == '-' || *p == '+') && isdigit((unsigned char)*(p+1)))
+           res = pdigit(&p, x);
+-      else if (islower((int)*p))
++      else if (islower((unsigned char)*p))
+           res = patom(&p, x);
+       else
+           res = -1;
+@@ -142,7 +142,7 @@ static int patom(const char** fmt, ei_x_
+     
+     for (;;) {
+       c = *(*fmt)++;
+-      if (isalnum((int) c) || (c == '_') || (c == '@'))
++      if (isalnum((unsigned char) c) || (c == '_') || (c == '@'))
+           continue;
+       else
+           break;
+@@ -168,7 +168,7 @@ static int pdigit(const char** fmt, ei_x
+       (*fmt)++;
+     for (;;) {
+       c = *(*fmt)++;
+-      if (isdigit((int)c))
++      if (isdigit((unsigned char)c))
+           continue;
+       else if (!dotp && (c == '.')) {
+           dotp = 1;
+@@ -304,7 +304,7 @@ static int ptuple(const char** fmt, unio
+       *fmt = p;
+       return size;
+     }
+-    while (isspace((int)*p))
++    while (isspace((unsigned char)*p))
+       ++p;
+     switch (*p++) {
+     case '}':
+@@ -342,7 +342,7 @@ static int plist(const char** fmt, union
+ 
+     if (after == ']')
+       --p;
+-    while (isspace((int)*p))
++    while (isspace((unsigned char)*p))
+       ++p;
+     switch (*p++) {
+     case ']':
+@@ -372,7 +372,7 @@ static int plist(const char** fmt, union
+       ++size;
+       if (res >= 0) {
+           if (after == '|') {
+-              while (isspace((int)*p))
++              while (isspace((unsigned char)*p))
+                   ++p;
+               if (*p != ']')
+                   res = -1;
+@@ -394,7 +394,7 @@ static int pmap(const char ** fmt, union
+     const char * p = *fmt;
+     int size = 0;
+ 
+-    while (isspace(*p))
++    while (isspace((unsigned char)*p))
+         ++p;
+ 
+     if (*p == '}') {
+@@ -406,7 +406,7 @@ static int pmap(const char ** fmt, union
+         /* Key */
+         if (eiformat(&p, args, x) < 0)
+             return -1;
+-        while (isspace(*p))
++        while (isspace((unsigned char)*p))
+             ++p;
+ 
+         if (!(p[0] == '=' && p[1] == '>')) {
+@@ -417,7 +417,7 @@ static int pmap(const char ** fmt, union
+         /* Value */
+         if (eiformat(&p, args, x) < 0)
+             return -1;
+-        while (isspace(*p))
++        while (isspace((unsigned char)*p))
+             ++p;
+ 
+         ++size;
+@@ -427,7 +427,7 @@ static int pmap(const char ** fmt, union
+         }
+         if (*p++ != ',')
+             return -1;
+-        while (isspace((int)*p))
++        while (isspace((unsigned char)*p))
+             ++p;
+     }
+ }
Index: pkgsrc/lang/erlang/patches/patch-lib_erl__interface_src_misc_ei__printterm.c
diff -u /dev/null pkgsrc/lang/erlang/patches/patch-lib_erl__interface_src_misc_ei__printterm.c:1.1
--- /dev/null   Mon May 27 19:07:50 2024
+++ pkgsrc/lang/erlang/patches/patch-lib_erl__interface_src_misc_ei__printterm.c        Mon May 27 19:07:50 2024
@@ -0,0 +1,18 @@
+$NetBSD: patch-lib_erl__interface_src_misc_ei__printterm.c,v 1.1 2024/05/27 19:07:50 riastradh Exp $
+
+Fix ctype(3) misuse.
+
+--- lib/erl_interface/src/misc/ei_printterm.c.orig     2024-03-06 15:30:18.000000000 +0000
++++ lib/erl_interface/src/misc/ei_printterm.c
+@@ -186,9 +186,9 @@ static int print_term(FILE* fp, ei_x_buf
+     case ERL_SMALL_ATOM_UTF8_EXT:
+       if (ei_decode_atom(buf, index, a) < 0)
+          goto err;
+-      doquote = !islower((int)a[0]);
++      doquote = !islower((unsigned char)a[0]);
+       for (p = a; !doquote && *p != '\0'; ++p)
+-          doquote = !(isalnum((int)*p) || *p == '_' || *p == '@');
++          doquote = !(isalnum((unsigned char)*p) || *p == '_' || *p == '@');
+       if (doquote) {
+           xputc('\'', fp, x); ++ch_written; 
+       }
Index: pkgsrc/lang/erlang/patches/patch-lib_erl__interface_src_prog_erl__call.c
diff -u /dev/null pkgsrc/lang/erlang/patches/patch-lib_erl__interface_src_prog_erl__call.c:1.1
--- /dev/null   Mon May 27 19:07:50 2024
+++ pkgsrc/lang/erlang/patches/patch-lib_erl__interface_src_prog_erl__call.c    Mon May 27 19:07:50 2024
@@ -0,0 +1,26 @@
+$NetBSD: patch-lib_erl__interface_src_prog_erl__call.c,v 1.1 2024/05/27 19:07:50 riastradh Exp $
+
+Fix ctype(3) misuse.
+
+--- lib/erl_interface/src/prog/erl_call.c.orig 2024-03-06 15:30:18.000000000 +0000
++++ lib/erl_interface/src/prog/erl_call.c
+@@ -852,8 +852,8 @@ static int do_connect(ei_cnode *ec, char
+     return fd;
+ } /* do_connect */
+ 
+-#define SKIP_SPACE(s) while(isspace((int)*(s))) (s)++
+-#define EAT(s) while (!isspace((int)*(s)) && (*(s) != '\0')) (s)++
++#define SKIP_SPACE(s) while(isspace((unsigned char)*(s))) (s)++
++#define EAT(s) while (!isspace((unsigned char)*(s)) && (*(s) != '\0')) (s)++
+ 
+ static void split_apply_string(char *str, 
+                              char **mod, 
+@@ -951,7 +951,7 @@ static int get_module(char **mbuf, char 
+     while ((*tmp) == ' ') tmp++; /* eat space */
+     start = tmp;
+     while (1) {
+-      if (isalnum((int)*tmp) || (*tmp == '_')) {
++      if (isalnum((unsigned char)*tmp) || (*tmp == '_')) {
+       tmp++;
+       continue;
+       } else {
Index: pkgsrc/lang/erlang/patches/patch-lib_inets_test_inets__socketwrap__SUITE__data_setuid__socket__wrap.c
diff -u /dev/null pkgsrc/lang/erlang/patches/patch-lib_inets_test_inets__socketwrap__SUITE__data_setuid__socket__wrap.c:1.1
--- /dev/null   Mon May 27 19:07:50 2024
+++ pkgsrc/lang/erlang/patches/patch-lib_inets_test_inets__socketwrap__SUITE__data_setuid__socket__wrap.c       Mon May 27 19:07:50 2024
@@ -0,0 +1,15 @@
+$NetBSD: patch-lib_inets_test_inets__socketwrap__SUITE__data_setuid__socket__wrap.c,v 1.1 2024/05/27 19:07:50 riastradh Exp $
+
+Fix ctype(3) misuse.
+
+--- lib/inets/test/inets_socketwrap_SUITE_data/setuid_socket_wrap.c.orig       2024-03-06 15:30:18.000000000 +0000
++++ lib/inets/test/inets_socketwrap_SUITE_data/setuid_socket_wrap.c
+@@ -66,7 +66,7 @@ int parse_addr(addr, str)
+     if ((cp = strrchr(str, (int)':')) != NULL)
+         *cp++ = '\0';
+     if (cp) {
+-        if (!isdigit((int)cp[0])) {
++        if (!isdigit((unsigned char)cp[0])) {
+             if ((se = getservbyname(cp, "tcp")) != NULL) {
+                 port = ntohs(se->s_port);
+           } else {
Index: pkgsrc/lang/erlang/patches/patch-lib_megaco_src_flex_megaco__flex__scanner__drv.flex.src
diff -u /dev/null pkgsrc/lang/erlang/patches/patch-lib_megaco_src_flex_megaco__flex__scanner__drv.flex.src:1.1
--- /dev/null   Mon May 27 19:07:50 2024
+++ pkgsrc/lang/erlang/patches/patch-lib_megaco_src_flex_megaco__flex__scanner__drv.flex.src    Mon May 27 19:07:50 2024
@@ -0,0 +1,33 @@
+$NetBSD: patch-lib_megaco_src_flex_megaco__flex__scanner__drv.flex.src,v 1.1 2024/05/27 19:07:50 riastradh Exp $
+
+Fix ctype(3) misuse.
+
+--- lib/megaco/src/flex/megaco_flex_scanner_drv.flex.src.orig  2024-05-02 13:07:57.000000000 +0000
++++ lib/megaco/src/flex/megaco_flex_scanner_drv.flex.src
+@@ -996,7 +996,7 @@ static void mfs_lower_load_token(ErlDrvT
+ 
+   } else {
+     for ( i = 0; i < yyleng; ++i ) {
+-      dataP->text_ptr[i] = tolower(yytext[i]);
++      dataP->text_ptr[i] = tolower((unsigned char)yytext[i]);
+     }
+     
+     DBG_BUF("mfs_lower_load_token", "dataP->text_ptr", 
+@@ -1302,7 +1302,7 @@ static void mfs_load_map_name()
+ #endif
+   
+   for ( i = 0; i < yyleng; ++i ) {
+-    dataP->text_ptr[i] = tolower(yytext[i]);
++    dataP->text_ptr[i] = tolower((unsigned char)yytext[i]);
+   }
+   
+   dataP->digit_map_name_ptr = dataP->text_ptr;
+@@ -1326,7 +1326,7 @@ static void mfs_load_map_value()
+ #endif
+   
+   for ( i = 0; i < yyleng; ++i ) {
+-    dataP->text_ptr[i] = tolower(yytext[i]);
++    dataP->text_ptr[i] = tolower((unsigned char)yytext[i]);
+   }
+   
+   dataP->digit_map_value_ptr = dataP->text_ptr;
Index: pkgsrc/lang/erlang/patches/patch-lib_odbc_c__src_odbcserver.c
diff -u /dev/null pkgsrc/lang/erlang/patches/patch-lib_odbc_c__src_odbcserver.c:1.1
--- /dev/null   Mon May 27 19:07:50 2024
+++ pkgsrc/lang/erlang/patches/patch-lib_odbc_c__src_odbcserver.c       Mon May 27 19:07:50 2024
@@ -0,0 +1,14 @@
+$NetBSD: patch-lib_odbc_c__src_odbcserver.c,v 1.1 2024/05/27 19:07:50 riastradh Exp $
+
+Fix ctype(3) misuse.
+
+--- lib/odbc/c_src/odbcserver.c.orig   2024-03-06 15:30:18.000000000 +0000
++++ lib/odbc/c_src/odbcserver.c
+@@ -2800,6 +2800,6 @@ static void str_tolower(char *str, int l
+       int i;
+       
+       for(i = 0; i <= len; i++) {
+-              str[i] = tolower(str[i]);
++              str[i] = tolower((unsigned char)str[i]);
+       }
+ }

Index: pkgsrc/lang/erlang/patches/patch-erts_emulator_sys_unix_sys.c
diff -u /dev/null pkgsrc/lang/erlang/patches/patch-erts_emulator_sys_unix_sys.c:1.3
--- /dev/null   Mon May 27 19:07:51 2024
+++ pkgsrc/lang/erlang/patches/patch-erts_emulator_sys_unix_sys.c       Mon May 27 19:07:50 2024
@@ -0,0 +1,26 @@
+$NetBSD: patch-erts_emulator_sys_unix_sys.c,v 1.3 2024/05/27 19:07:50 riastradh Exp $
+
+Fix ctype(3) misuse.
+
+--- erts/emulator/sys/unix/sys.c.orig  2024-03-06 15:30:18.000000000 +0000
++++ erts/emulator/sys/unix/sys.c
+@@ -717,7 +717,7 @@ get_number(char **str_ptr)
+     char* s = *str_ptr;               /* Pointer to beginning of string. */
+     char* dot;                        /* Pointer to dot in string or NULL. */
+ 
+-    if (!isdigit((int) *s))
++    if (!isdigit((unsigned char) *s))
+       return 0;
+     if ((dot = strchr(s, '.')) == NULL) {
+       *str_ptr = s+strlen(s);
+@@ -735,8 +735,8 @@ void os_flavor(char* namebuf, unsigned s
+ 
+     (void) uname(&uts);
+     for (s = uts.sysname; *s; s++) {
+-      if (isupper((int) *s)) {
+-          *s = tolower((int) *s);
++      if (isupper((unsigned char) *s)) {
++          *s = tolower((unsigned char) *s);
+       }
+     }
+     strcpy(namebuf, uts.sysname);



Home | Main Index | Thread Index | Old Index