Thu Nov 5 17:45:55 2020 UTC ()
libxml2: Fix building with ICU 68.1


(adam)
diff -r1.132 -r1.133 pkgsrc/textproc/libxml2/distinfo
diff -r1.2 -r1.3 pkgsrc/textproc/libxml2/patches/patch-encoding.c

cvs diff -r1.132 -r1.133 pkgsrc/textproc/libxml2/distinfo (expand / switch to unified diff)

--- pkgsrc/textproc/libxml2/distinfo 2020/01/24 10:40:36 1.132
+++ pkgsrc/textproc/libxml2/distinfo 2020/11/05 17:45:55 1.133
@@ -1,18 +1,18 @@ @@ -1,18 +1,18 @@
1$NetBSD: distinfo,v 1.132 2020/01/24 10:40:36 kim Exp $ 1$NetBSD: distinfo,v 1.133 2020/11/05 17:45:55 adam Exp $
2 2
3SHA1 (libxml2-2.9.10.tar.gz) = db6592ec9ca9708c4e71bf6bfd907bbb5cd40644 3SHA1 (libxml2-2.9.10.tar.gz) = db6592ec9ca9708c4e71bf6bfd907bbb5cd40644
4RMD160 (libxml2-2.9.10.tar.gz) = 455f81e1f121c63dac96802de7f83ce4483f1afe 4RMD160 (libxml2-2.9.10.tar.gz) = 455f81e1f121c63dac96802de7f83ce4483f1afe
5SHA512 (libxml2-2.9.10.tar.gz) = 0adfd12bfde89cbd6296ba6e66b6bed4edb814a74b4265bda34d95c41d9d92c696ee7adb0c737aaf9cc6e10426a31a35079b2a23d26c074e299858da12c072ed 5SHA512 (libxml2-2.9.10.tar.gz) = 0adfd12bfde89cbd6296ba6e66b6bed4edb814a74b4265bda34d95c41d9d92c696ee7adb0c737aaf9cc6e10426a31a35079b2a23d26c074e299858da12c072ed
6Size (libxml2-2.9.10.tar.gz) = 5624761 bytes 6Size (libxml2-2.9.10.tar.gz) = 5624761 bytes
7SHA1 (patch-Makefile.in) = e687eaa9805b855b0c8a944ec5c597bd34954472 7SHA1 (patch-Makefile.in) = e687eaa9805b855b0c8a944ec5c597bd34954472
8SHA1 (patch-catalog.c) = 34afe787f6012b460a85be993048e133907a1621 8SHA1 (patch-catalog.c) = 34afe787f6012b460a85be993048e133907a1621
9SHA1 (patch-configure) = f6e9f08377a537657df08deee17a5cc66c60b808 9SHA1 (patch-configure) = f6e9f08377a537657df08deee17a5cc66c60b808
10SHA1 (patch-doc_examples_Makefile.in) = 4eede9719724f94402e850ee6d6043a74aaf62b2 10SHA1 (patch-doc_examples_Makefile.in) = 4eede9719724f94402e850ee6d6043a74aaf62b2
11SHA1 (patch-encoding.c) = 6cf0a7d421828b9f40a4079ee85adb791c54d096 11SHA1 (patch-encoding.c) = 62b3343f0a0ea51e3fb8eb693e495520eefb6ffd
12SHA1 (patch-parser.c) = 9dcda6b8bc71c1abb095fc2c840ac40c1ae04a33 12SHA1 (patch-parser.c) = 9dcda6b8bc71c1abb095fc2c840ac40c1ae04a33
13SHA1 (patch-python_libxml.c) = cfa07b4f3dfddb501c2ba210bb32b8ee14e3df9d 13SHA1 (patch-python_libxml.c) = cfa07b4f3dfddb501c2ba210bb32b8ee14e3df9d
14SHA1 (patch-python_libxml.py) = 869a72ae5ba2e27e6d46552878890acb22337675 14SHA1 (patch-python_libxml.py) = 869a72ae5ba2e27e6d46552878890acb22337675
15SHA1 (patch-python_libxml2.py) = 209d105b0f3aedb834091390a7c6819705108e34 15SHA1 (patch-python_libxml2.py) = 209d105b0f3aedb834091390a7c6819705108e34
16SHA1 (patch-python_setup.py) = 7771fd02ee6779463f1d3321f099d7e6d19cd1b1 16SHA1 (patch-python_setup.py) = 7771fd02ee6779463f1d3321f099d7e6d19cd1b1
17SHA1 (patch-xmlcatalog.c) = d65b7e3be9694147e96ce4bb70a1739e2279ba81 17SHA1 (patch-xmlcatalog.c) = d65b7e3be9694147e96ce4bb70a1739e2279ba81
18SHA1 (patch-xmlschemas.c) = edd5be08e7b19ab8e35412b854e95dedbb7befdd 18SHA1 (patch-xmlschemas.c) = edd5be08e7b19ab8e35412b854e95dedbb7befdd

cvs diff -r1.2 -r1.3 pkgsrc/textproc/libxml2/patches/patch-encoding.c (expand / switch to unified diff)

--- pkgsrc/textproc/libxml2/patches/patch-encoding.c 2016/05/24 21:08:21 1.2
+++ pkgsrc/textproc/libxml2/patches/patch-encoding.c 2020/11/05 17:45:55 1.3
@@ -1,65 +1,78 @@ @@ -1,65 +1,78 @@
1$NetBSD: patch-encoding.c,v 1.2 2016/05/24 21:08:21 wiz Exp $ 1$NetBSD: patch-encoding.c,v 1.3 2020/11/05 17:45:55 adam Exp $
2 2
 3Fix building with ICU 68.1.
3Avoid potential undefined behaviour by casting arg to toupper() 4Avoid potential undefined behaviour by casting arg to toupper()
4to an appropriate value range. 5to an appropriate value range.
5https://bugzilla.gnome.org/show_bug.cgi?id=766838 6https://bugzilla.gnome.org/show_bug.cgi?id=766838
6 7
7Also, on NetBSD, add CP1141 encoding alias. 8Also, on NetBSD, add CP1141 encoding alias.
8 9
9--- encoding.c.orig 2016-05-23 07:25:25.000000000 +0000 10--- encoding.c.orig 2019-10-22 18:46:01.000000000 +0000
10+++ encoding.c 11+++ encoding.c
11@@ -1018,7 +1018,7 @@ xmlGetEncodingAlias(const char *alias) { 12@@ -48,6 +48,11 @@
 13 #include "buf.h"
 14 #include "enc.h"
 15
 16+#if !defined(FALSE)
 17+# define FALSE (1 == 0)
 18+# define TRUE (! FALSE)
 19+#endif
 20+
 21 static xmlCharEncodingHandlerPtr xmlUTF16LEHandler = NULL;
 22 static xmlCharEncodingHandlerPtr xmlUTF16BEHandler = NULL;
 23
 24@@ -1027,7 +1032,7 @@ xmlGetEncodingAlias(const char *alias) {
12 return(NULL); 25 return(NULL);
13  26
14 for (i = 0;i < 99;i++) { 27 for (i = 0;i < 99;i++) {
15- upper[i] = toupper(alias[i]); 28- upper[i] = toupper(alias[i]);
16+ upper[i] = toupper((unsigned char)alias[i]); 29+ upper[i] = toupper((unsigned char)alias[i]);
17 if (upper[i] == 0) break; 30 if (upper[i] == 0) break;
18 } 31 }
19 upper[i] = 0; 32 upper[i] = 0;
20@@ -1053,7 +1053,7 @@ xmlAddEncodingAlias(const char *name, co 33@@ -1062,7 +1067,7 @@ xmlAddEncodingAlias(const char *name, co
21 return(-1); 34 return(-1);
22  35
23 for (i = 0;i < 99;i++) { 36 for (i = 0;i < 99;i++) {
24- upper[i] = toupper(alias[i]); 37- upper[i] = toupper(alias[i]);
25+ upper[i] = toupper((unsigned char)alias[i]); 38+ upper[i] = toupper((unsigned char)alias[i]);
26 if (upper[i] == 0) break; 39 if (upper[i] == 0) break;
27 } 40 }
28 upper[i] = 0; 41 upper[i] = 0;
29@@ -1155,7 +1155,7 @@ xmlParseCharEncoding(const char* name) 42@@ -1164,7 +1169,7 @@ xmlParseCharEncoding(const char* name)
30 name = alias; 43 name = alias;
31  44
32 for (i = 0;i < 499;i++) { 45 for (i = 0;i < 499;i++) {
33- upper[i] = toupper(name[i]); 46- upper[i] = toupper(name[i]);
34+ upper[i] = toupper((unsigned char)name[i]); 47+ upper[i] = toupper((unsigned char)name[i]);
35 if (upper[i] == 0) break; 48 if (upper[i] == 0) break;
36 } 49 }
37 upper[i] = 0; 50 upper[i] = 0;
38@@ -1331,7 +1331,7 @@ xmlNewCharEncodingHandler(const char *na 51@@ -1340,7 +1345,7 @@ xmlNewCharEncodingHandler(const char *na
39 return(NULL); 52 return(NULL);
40 } 53 }
41 for (i = 0;i < 499;i++) { 54 for (i = 0;i < 499;i++) {
42- upper[i] = toupper(name[i]); 55- upper[i] = toupper(name[i]);
43+ upper[i] = toupper((unsigned char)name[i]); 56+ upper[i] = toupper((unsigned char)name[i]);
44 if (upper[i] == 0) break; 57 if (upper[i] == 0) break;
45 } 58 }
46 upper[i] = 0; 59 upper[i] = 0;
47@@ -1433,6 +1433,9 @@ xmlInitCharEncodingHandlers(void) { 60@@ -1442,6 +1447,9 @@ xmlInitCharEncodingHandlers(void) {
48 xmlRegisterCharEncodingHandlersISO8859x (); 61 xmlRegisterCharEncodingHandlersISO8859x ();
49 #endif 62 #endif
50 #endif 63 #endif
51+#ifdef __NetBSD__ /* XXX needed by selftest */ 64+#ifdef __NetBSD__ /* XXX needed by selftest */
52+ xmlAddEncodingAlias("CP1141", "IBM-1141"); 65+ xmlAddEncodingAlias("CP1141", "IBM-1141");
53+#endif 66+#endif
54  67
55 } 68 }
56  69
57@@ -1660,7 +1663,7 @@ xmlFindCharEncodingHandler(const char *n 70@@ -1669,7 +1677,7 @@ xmlFindCharEncodingHandler(const char *n
58 * Check first for directly registered encoding names 71 * Check first for directly registered encoding names
59 */ 72 */
60 for (i = 0;i < 99;i++) { 73 for (i = 0;i < 99;i++) {
61- upper[i] = toupper(name[i]); 74- upper[i] = toupper(name[i]);
62+ upper[i] = toupper((unsigned char)name[i]); 75+ upper[i] = toupper((unsigned char)name[i]);
63 if (upper[i] == 0) break; 76 if (upper[i] == 0) break;
64 } 77 }
65 upper[i] = 0; 78 upper[i] = 0;