pkgsrc-Changes archive

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

CVS commit: pkgsrc/devel/pkgconf



Module Name:    pkgsrc
Committed By:   riastradh
Date:           Fri Mar 17 20:20:45 UTC 2023

Modified Files:
        pkgsrc/devel/pkgconf: Makefile distinfo
Added Files:
        pkgsrc/devel/pkgconf/patches: patch-cli_bomtool_main.c patch-cli_main.c
            patch-libpkgconf_argvsplit.c patch-libpkgconf_dependency.c
            patch-libpkgconf_libpkgconf.h patch-libpkgconf_parser.c
            patch-libpkgconf_personality.c patch-libpkgconf_pkg.c
            patch-libpkgconf_win-dirent.h

Log Message:
pkgconf: Patch away ctype(3) misuse.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 pkgsrc/devel/pkgconf/Makefile
cvs rdiff -u -r1.17 -r1.18 pkgsrc/devel/pkgconf/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/devel/pkgconf/patches/patch-cli_bomtool_main.c \
    pkgsrc/devel/pkgconf/patches/patch-cli_main.c \
    pkgsrc/devel/pkgconf/patches/patch-libpkgconf_argvsplit.c \
    pkgsrc/devel/pkgconf/patches/patch-libpkgconf_dependency.c \
    pkgsrc/devel/pkgconf/patches/patch-libpkgconf_libpkgconf.h \
    pkgsrc/devel/pkgconf/patches/patch-libpkgconf_parser.c \
    pkgsrc/devel/pkgconf/patches/patch-libpkgconf_personality.c \
    pkgsrc/devel/pkgconf/patches/patch-libpkgconf_pkg.c \
    pkgsrc/devel/pkgconf/patches/patch-libpkgconf_win-dirent.h

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

Modified files:

Index: pkgsrc/devel/pkgconf/Makefile
diff -u pkgsrc/devel/pkgconf/Makefile:1.21 pkgsrc/devel/pkgconf/Makefile:1.22
--- pkgsrc/devel/pkgconf/Makefile:1.21  Sat Feb  4 14:08:03 2023
+++ pkgsrc/devel/pkgconf/Makefile       Fri Mar 17 20:20:45 2023
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.21 2023/02/04 14:08:03 wiz Exp $
+# $NetBSD: Makefile,v 1.22 2023/03/17 20:20:45 riastradh Exp $
 
 DISTNAME=      pkgconf-1.9.4
+PKGREVISION=   1
 CATEGORIES=    devel
 MASTER_SITES=  https://distfiles.dereferenced.org/pkgconf/
 

Index: pkgsrc/devel/pkgconf/distinfo
diff -u pkgsrc/devel/pkgconf/distinfo:1.17 pkgsrc/devel/pkgconf/distinfo:1.18
--- pkgsrc/devel/pkgconf/distinfo:1.17  Sat Feb  4 14:08:03 2023
+++ pkgsrc/devel/pkgconf/distinfo       Fri Mar 17 20:20:45 2023
@@ -1,5 +1,14 @@
-$NetBSD: distinfo,v 1.17 2023/02/04 14:08:03 wiz Exp $
+$NetBSD: distinfo,v 1.18 2023/03/17 20:20:45 riastradh Exp $
 
 BLAKE2s (pkgconf-1.9.4.tar.gz) = 9623ac8227fc71344f60e1764df30f4b83efce712cdf36452476761539cba574
 SHA512 (pkgconf-1.9.4.tar.gz) = 20270fbac82f6729e00a26a9271c72ae86f9773e46d161b7cbf78a3ebde81742d7f9badd2d755d4a1e471a4294ce25c999601d0fa9a6ff50fbd856e5e8a8a820
 Size (pkgconf-1.9.4.tar.gz) = 447284 bytes
+SHA1 (patch-cli_bomtool_main.c) = b18db0fc13617abd1edc554416f1c1609bc2daf2
+SHA1 (patch-cli_main.c) = 1d8fb3830a51a36b5ff4cbb8b4bb9caf4d0cc5b0
+SHA1 (patch-libpkgconf_argvsplit.c) = c63e14cfc2f9a1a0cb3bd91088999ff4e7cb72f6
+SHA1 (patch-libpkgconf_dependency.c) = efcbf7b37a91abcab84ade11d4d7aa615c975779
+SHA1 (patch-libpkgconf_libpkgconf.h) = 62273c4df210d378332346ff3c422b230cef04bd
+SHA1 (patch-libpkgconf_parser.c) = b6c4de629abd3e34e1f44fa1097583b68887e071
+SHA1 (patch-libpkgconf_personality.c) = 2f21573844cfedaf230ea2e27cb706f372513bfe
+SHA1 (patch-libpkgconf_pkg.c) = b42ee38544fd1c011956e770bed886b8adfba2d6
+SHA1 (patch-libpkgconf_win-dirent.h) = 7c450078564f27db5dfe94bdfe326f5d805ac912

Added files:

Index: pkgsrc/devel/pkgconf/patches/patch-cli_bomtool_main.c
diff -u /dev/null pkgsrc/devel/pkgconf/patches/patch-cli_bomtool_main.c:1.1
--- /dev/null   Fri Mar 17 20:20:45 2023
+++ pkgsrc/devel/pkgconf/patches/patch-cli_bomtool_main.c       Fri Mar 17 20:20:45 2023
@@ -0,0 +1,17 @@
+$NetBSD: patch-cli_bomtool_main.c,v 1.1 2023/03/17 20:20:45 riastradh Exp $
+
+Fix ctype(3) misuse.
+https://github.com/pkgconf/pkgconf/issues/291
+https://github.com/pkgconf/pkgconf/pull/292
+
+--- cli/bomtool/main.c.orig    2023-01-20 21:03:49.000000000 +0000
++++ cli/bomtool/main.c
+@@ -309,7 +309,7 @@ main(int argc, char *argv[])
+               if (maximum_package_count > 0 && pkgq.length > maximum_package_count)
+                       break;
+ 
+-              while (isspace((unsigned int)package[0]))
++              while (isspace((unsigned char)package[0]))
+                       package++;
+ 
+               /* skip empty packages */
Index: pkgsrc/devel/pkgconf/patches/patch-cli_main.c
diff -u /dev/null pkgsrc/devel/pkgconf/patches/patch-cli_main.c:1.1
--- /dev/null   Fri Mar 17 20:20:45 2023
+++ pkgsrc/devel/pkgconf/patches/patch-cli_main.c       Fri Mar 17 20:20:45 2023
@@ -0,0 +1,27 @@
+$NetBSD: patch-cli_main.c,v 1.1 2023/03/17 20:20:45 riastradh Exp $
+
+Fix ctype(3) misuse.
+https://github.com/pkgconf/pkgconf/issues/291
+https://github.com/pkgconf/pkgconf/pull/292
+
+--- cli/main.c.orig    2023-01-21 21:40:17.000000000 +0000
++++ cli/main.c
+@@ -407,7 +407,8 @@ apply_env(pkgconf_client_t *client, pkgc
+       char workbuf[PKGCONF_ITEM_SIZE];
+ 
+       for (it = want_env_prefix; *it != '\0'; it++)
+-              if (!isalpha(*it) && !isdigit(*it))
++              if (!isalpha((unsigned char)*it) &&
++                  !isdigit((unsigned char)*it))
+                       return false;
+ 
+       snprintf(workbuf, sizeof workbuf, "%s_CFLAGS", want_env_prefix);
+@@ -1327,7 +1328,7 @@ cleanup3:
+               if (maximum_package_count > 0 && pkgq.length > maximum_package_count)
+                       break;
+ 
+-              while (isspace((unsigned int)package[0]))
++              while (isspace((unsigned char)package[0]))
+                       package++;
+ 
+               /* skip empty packages */
Index: pkgsrc/devel/pkgconf/patches/patch-libpkgconf_argvsplit.c
diff -u /dev/null pkgsrc/devel/pkgconf/patches/patch-libpkgconf_argvsplit.c:1.1
--- /dev/null   Fri Mar 17 20:20:45 2023
+++ pkgsrc/devel/pkgconf/patches/patch-libpkgconf_argvsplit.c   Fri Mar 17 20:20:45 2023
@@ -0,0 +1,17 @@
+$NetBSD: patch-libpkgconf_argvsplit.c,v 1.1 2023/03/17 20:20:45 riastradh Exp $
+
+Fix ctype(3) misuse.
+https://github.com/pkgconf/pkgconf/issues/291
+https://github.com/pkgconf/pkgconf/pull/292
+
+--- libpkgconf/argvsplit.c.orig        2023-01-21 19:50:40.000000000 +0000
++++ libpkgconf/argvsplit.c
+@@ -108,7 +108,7 @@ pkgconf_argv_split(const char *src, int 
+                       else
+                               *dst_iter++ = *src_iter;
+               }
+-              else if (isspace((unsigned int)*src_iter))
++              else if (isspace((unsigned char)*src_iter))
+               {
+                       if ((*argv)[argc_count] != NULL)
+                       {
Index: pkgsrc/devel/pkgconf/patches/patch-libpkgconf_dependency.c
diff -u /dev/null pkgsrc/devel/pkgconf/patches/patch-libpkgconf_dependency.c:1.1
--- /dev/null   Fri Mar 17 20:20:45 2023
+++ pkgsrc/devel/pkgconf/patches/patch-libpkgconf_dependency.c  Fri Mar 17 20:20:45 2023
@@ -0,0 +1,31 @@
+$NetBSD: patch-libpkgconf_dependency.c,v 1.1 2023/03/17 20:20:45 riastradh Exp $
+
+Fix ctype(3) misuse.
+https://github.com/pkgconf/pkgconf/issues/291
+https://github.com/pkgconf/pkgconf/pull/292
+
+--- libpkgconf/dependency.c.orig       2023-01-20 21:03:49.000000000 +0000
++++ libpkgconf/dependency.c
+@@ -329,11 +329,11 @@ pkgconf_dependency_parse_str(pkgconf_cli
+                       break;
+ 
+               case INSIDE_MODULE_NAME:
+-                      if (isspace((unsigned int)*ptr))
++                      if (isspace((unsigned char)*ptr))
+                       {
+                               const char *sptr = ptr;
+ 
+-                              while (*sptr && isspace((unsigned int)*sptr))
++                              while (*sptr && isspace((unsigned char)*sptr))
+                                       sptr++;
+ 
+                               if (*sptr == '\0')
+@@ -397,7 +397,7 @@ pkgconf_dependency_parse_str(pkgconf_cli
+                       break;
+ 
+               case AFTER_OPERATOR:
+-                      if (!isspace((unsigned int)*ptr))
++                      if (!isspace((unsigned char)*ptr))
+                       {
+                               vstart = ptr;
+                               state = INSIDE_VERSION;
Index: pkgsrc/devel/pkgconf/patches/patch-libpkgconf_libpkgconf.h
diff -u /dev/null pkgsrc/devel/pkgconf/patches/patch-libpkgconf_libpkgconf.h:1.1
--- /dev/null   Fri Mar 17 20:20:45 2023
+++ pkgsrc/devel/pkgconf/patches/patch-libpkgconf_libpkgconf.h  Fri Mar 17 20:20:45 2023
@@ -0,0 +1,17 @@
+$NetBSD: patch-libpkgconf_libpkgconf.h,v 1.1 2023/03/17 20:20:45 riastradh Exp $
+
+Fix ctype(3) misuse.
+https://github.com/pkgconf/pkgconf/issues/291
+https://github.com/pkgconf/pkgconf/pull/292
+
+--- libpkgconf/libpkgconf.h.orig       2023-01-22 04:55:57.000000000 +0000
++++ libpkgconf/libpkgconf.h
+@@ -249,7 +249,7 @@ PKGCONF_API pkgconf_cross_personality_t 
+ PKGCONF_API pkgconf_cross_personality_t *pkgconf_cross_personality_find(const char *triplet);
+ PKGCONF_API void pkgconf_cross_personality_deinit(pkgconf_cross_personality_t *personality);
+ 
+-#define PKGCONF_IS_MODULE_SEPARATOR(c) ((c) == ',' || isspace ((unsigned int)(c)))
++#define PKGCONF_IS_MODULE_SEPARATOR(c) ((c) == ',' || isspace ((unsigned char)(c)))
+ #define PKGCONF_IS_OPERATOR_CHAR(c) ((c) == '<' || (c) == '>' || (c) == '!' || (c) == '=')
+ 
+ #define PKGCONF_PKG_PKGF_NONE                         0x0000
Index: pkgsrc/devel/pkgconf/patches/patch-libpkgconf_parser.c
diff -u /dev/null pkgsrc/devel/pkgconf/patches/patch-libpkgconf_parser.c:1.1
--- /dev/null   Fri Mar 17 20:20:45 2023
+++ pkgsrc/devel/pkgconf/patches/patch-libpkgconf_parser.c      Fri Mar 17 20:20:45 2023
@@ -0,0 +1,50 @@
+$NetBSD: patch-libpkgconf_parser.c,v 1.1 2023/03/17 20:20:45 riastradh Exp $
+
+Fix ctype(3) misuse.
+https://github.com/pkgconf/pkgconf/issues/291
+https://github.com/pkgconf/pkgconf/pull/292
+
+--- libpkgconf/parser.c.orig   2023-01-21 20:09:52.000000000 +0000
++++ libpkgconf/parser.c
+@@ -44,7 +44,7 @@ pkgconf_parser_parse(FILE *f, void *data
+               lineno++;
+ 
+               p = readbuf;
+-              while (*p && isspace((unsigned int)*p))
++              while (*p && isspace((unsigned char)*p))
+                       p++;
+               if (*p && p != readbuf)
+               {
+@@ -53,13 +53,14 @@ pkgconf_parser_parse(FILE *f, void *data
+                       warned_key_whitespace = true;
+               }
+               key = p;
+-              while (*p && (isalpha((unsigned int)*p) || isdigit((unsigned int)*p) || *p == '_' || *p == '.'))
++              while (*p && (isalpha((unsigned char)*p) || isdigit((unsigned char)*p) || *p == '_' || *p == '.'))
+                       p++;
+ 
+-              if (!isalpha((unsigned int)*key) && !isdigit((unsigned int)*p))
++              if (!isalpha((unsigned char)*key) &&
++                  !isdigit((unsigned char)*p))
+                       continue;
+ 
+-              while (*p && isspace((unsigned int)*p))
++              while (*p && isspace((unsigned char)*p))
+               {
+                       if (!warned_key_whitespace)
+                       {
+@@ -80,12 +81,12 @@ pkgconf_parser_parse(FILE *f, void *data
+                       p++;
+               }
+ 
+-              while (*p && isspace((unsigned int)*p))
++              while (*p && isspace((unsigned char)*p))
+                       p++;
+ 
+               value = p;
+               p = value + (strlen(value) - 1);
+-              while (*p && isspace((unsigned int) *p) && p > value)
++              while (*p && isspace((unsigned char) *p) && p > value)
+               {
+                       if (!warned_value_whitespace && op == '=')
+                       {
Index: pkgsrc/devel/pkgconf/patches/patch-libpkgconf_personality.c
diff -u /dev/null pkgsrc/devel/pkgconf/patches/patch-libpkgconf_personality.c:1.1
--- /dev/null   Fri Mar 17 20:20:45 2023
+++ pkgsrc/devel/pkgconf/patches/patch-libpkgconf_personality.c Fri Mar 17 20:20:45 2023
@@ -0,0 +1,17 @@
+$NetBSD: patch-libpkgconf_personality.c,v 1.1 2023/03/17 20:20:45 riastradh Exp $
+
+Fix ctype(3) misuse.
+https://github.com/pkgconf/pkgconf/issues/291
+https://github.com/pkgconf/pkgconf/pull/292
+
+--- libpkgconf/personality.c.orig      2022-06-26 03:11:36.000000000 +0000
++++ libpkgconf/personality.c
+@@ -141,7 +141,7 @@ valid_triplet(const char *triplet)
+       const char *c = triplet;
+ 
+       for (; *c; c++)
+-              if (!isalnum(*c) && *c != '-' && *c != '_')
++              if (!isalnum((unsigned char)*c) && *c != '-' && *c != '_')
+                       return false;
+ 
+       return true;
Index: pkgsrc/devel/pkgconf/patches/patch-libpkgconf_pkg.c
diff -u /dev/null pkgsrc/devel/pkgconf/patches/patch-libpkgconf_pkg.c:1.1
--- /dev/null   Fri Mar 17 20:20:45 2023
+++ pkgsrc/devel/pkgconf/patches/patch-libpkgconf_pkg.c Fri Mar 17 20:20:45 2023
@@ -0,0 +1,48 @@
+$NetBSD: patch-libpkgconf_pkg.c,v 1.1 2023/03/17 20:20:45 riastradh Exp $
+
+Fix ctype(3) misuse.
+https://github.com/pkgconf/pkgconf/issues/291
+https://github.com/pkgconf/pkgconf/pull/292
+
+--- libpkgconf/pkg.c.orig      2023-01-21 21:27:30.000000000 +0000
++++ libpkgconf/pkg.c
+@@ -857,9 +857,9 @@ pkgconf_compare_version(const char *a, c
+ 
+       while (*one || *two)
+       {
+-              while (*one && !isalnum((unsigned int)*one) && *one != '~')
++              while (*one && !isalnum((unsigned char)*one) && *one != '~')
+                       one++;
+-              while (*two && !isalnum((unsigned int)*two) && *two != '~')
++              while (*two && !isalnum((unsigned char)*two) && *two != '~')
+                       two++;
+ 
+               if (*one == '~' || *two == '~')
+@@ -880,22 +880,22 @@ pkgconf_compare_version(const char *a, c
+               str1 = one;
+               str2 = two;
+ 
+-              if (isdigit((unsigned int)*str1))
++              if (isdigit((unsigned char)*str1))
+               {
+-                      while (*str1 && isdigit((unsigned int)*str1))
++                      while (*str1 && isdigit((unsigned char)*str1))
+                               str1++;
+ 
+-                      while (*str2 && isdigit((unsigned int)*str2))
++                      while (*str2 && isdigit((unsigned char)*str2))
+                               str2++;
+ 
+                       isnum = true;
+               }
+               else
+               {
+-                      while (*str1 && isalpha((unsigned int)*str1))
++                      while (*str1 && isalpha((unsigned char)*str1))
+                               str1++;
+ 
+-                      while (*str2 && isalpha((unsigned int)*str2))
++                      while (*str2 && isalpha((unsigned char)*str2))
+                               str2++;
+ 
+                       isnum = false;
Index: pkgsrc/devel/pkgconf/patches/patch-libpkgconf_win-dirent.h
diff -u /dev/null pkgsrc/devel/pkgconf/patches/patch-libpkgconf_win-dirent.h:1.1
--- /dev/null   Fri Mar 17 20:20:45 2023
+++ pkgsrc/devel/pkgconf/patches/patch-libpkgconf_win-dirent.h  Fri Mar 17 20:20:45 2023
@@ -0,0 +1,48 @@
+$NetBSD: patch-libpkgconf_win-dirent.h,v 1.1 2023/03/17 20:20:45 riastradh Exp $
+
+Fix ctype(3) misuse.
+https://github.com/pkgconf/pkgconf/issues/291
+https://github.com/pkgconf/pkgconf/pull/292
+
+--- libpkgconf/win-dirent.h.orig       2022-06-26 03:11:36.000000000 +0000
++++ libpkgconf/win-dirent.h
+@@ -912,7 +912,7 @@ static int strverscmp(const char *a, con
+ 
+       /* Count backwards and find the leftmost digit */
+       j = i;
+-      while (j > 0 && isdigit(a[j-1])) {
++      while (j > 0 && isdigit((unsigned char)a[j-1])) {
+               --j;
+       }
+ 
+@@ -924,23 +924,24 @@ static int strverscmp(const char *a, con
+               }
+ 
+               /* String with more digits is smaller, e.g 002 < 01 */
+-              if (isdigit(a[j])) {
+-                      if (!isdigit(b[j])) {
++              if (isdigit((unsigned char)a[j])) {
++                      if (!isdigit((unsigned char)b[j])) {
+                               return -1;
+                       }
+-              } else if (isdigit(b[j])) {
++              } else if ((unsigned char)isdigit(b[j])) {
+                       return 1;
+               }
+-      } else if (isdigit(a[j]) && isdigit(b[j])) {
++      } else if ((unsigned char)isdigit(a[j]) &&
++          isdigit((unsigned char)b[j])) {
+               /* Numeric comparison */
+               size_t k1 = j;
+               size_t k2 = j;
+ 
+               /* Compute number of digits in each string */
+-              while (isdigit(a[k1])) {
++              while (isdigit((unsigned char)a[k1])) {
+                       k1++;
+               }
+-              while (isdigit(b[k2])) {
++              while (isdigit((unsigned char)b[k2])) {
+                       k2++;
+               }
+ 



Home | Main Index | Thread Index | Old Index