pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/textproc/the_silver_searcher/patches
Module Name: pkgsrc
Committed By: leot
Date: Fri Aug 29 12:17:50 UTC 2025
Added Files:
pkgsrc/textproc/the_silver_searcher/patches: patch-src_ignore.c
patch-src_util.c
Log Message:
the_silver_searcher: add missing patches
To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 \
pkgsrc/textproc/the_silver_searcher/patches/patch-src_ignore.c
cvs rdiff -u -r0 -r1.3 \
pkgsrc/textproc/the_silver_searcher/patches/patch-src_util.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Added files:
Index: pkgsrc/textproc/the_silver_searcher/patches/patch-src_ignore.c
diff -u /dev/null pkgsrc/textproc/the_silver_searcher/patches/patch-src_ignore.c:1.1
--- /dev/null Fri Aug 29 12:17:50 2025
+++ pkgsrc/textproc/the_silver_searcher/patches/patch-src_ignore.c Fri Aug 29 12:17:50 2025
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_ignore.c,v 1.1 2025/08/29 12:17:50 leot Exp $
+
+Fix ctype(3) abuses.
+
+--- src/ignore.c.orig 2025-08-29 12:08:03.916286916 +0000
++++ src/ignore.c
+@@ -105,7 +105,7 @@ void add_ignore_pattern(ignores *ig, con
+
+ /* Kill trailing whitespace */
+ for (pattern_len = strlen(pattern); pattern_len > 0; pattern_len--) {
+- if (!isspace(pattern[pattern_len - 1])) {
++ if (!isspace((unsigned char)pattern[pattern_len - 1])) {
+ break;
+ }
+ }
Index: pkgsrc/textproc/the_silver_searcher/patches/patch-src_util.c
diff -u /dev/null pkgsrc/textproc/the_silver_searcher/patches/patch-src_util.c:1.3
--- /dev/null Fri Aug 29 12:17:50 2025
+++ pkgsrc/textproc/the_silver_searcher/patches/patch-src_util.c Fri Aug 29 12:17:50 2025
@@ -0,0 +1,71 @@
+$NetBSD: patch-src_util.c,v 1.3 2025/08/29 12:17:50 leot Exp $
+
+Fix ctype(3) abuses
+
+--- src/util.c.orig 2025-08-29 12:08:47.866239353 +0000
++++ src/util.c
+@@ -77,8 +77,8 @@ void generate_alpha_skip(const char *fin
+ if (case_sensitive) {
+ skip_lookup[(unsigned char)find[i]] = f_len - i;
+ } else {
+- skip_lookup[(unsigned char)tolower(find[i])] = f_len - i;
+- skip_lookup[(unsigned char)toupper(find[i])] = f_len - i;
++ skip_lookup[(unsigned char)tolower((unsigned char)find[i])] = f_len - i;
++ skip_lookup[(unsigned char)toupper((unsigned char)find[i])] = f_len - i;
+ }
+ }
+ }
+@@ -92,7 +92,7 @@ int is_prefix(const char *s, const size_
+ return 0;
+ }
+ } else {
+- if (tolower(s[i]) != tolower(s[i + pos])) {
++ if (tolower((unsigned char)s[i]) != tolower((unsigned char)s[i + pos])) {
+ return 0;
+ }
+ }
+@@ -110,7 +110,7 @@ size_t suffix_len(const char *s, const s
+ break;
+ }
+ } else {
+- if (tolower(s[pos - i]) != tolower(s[s_len - i - 1])) {
++ if (tolower((unsigned char)s[pos - i]) != tolower((unsigned char)s[s_len - i - 1])) {
+ break;
+ }
+ }
+@@ -188,7 +188,7 @@ const char *boyer_moore_strnstr(const ch
+ size_t pos = f_len - 1;
+
+ while (pos < s_len) {
+- for (i = f_len - 1; i >= 0 && (case_insensitive ? tolower(s[pos]) : s[pos]) == find[i]; pos--, i--) {
++ for (i = f_len - 1; i >= 0 && (case_insensitive ? tolower((unsigned char)s[pos]) : s[pos]) == find[i]; pos--, i--) {
+ }
+ if (i < 0) {
+ return s + pos + 1;
+@@ -215,7 +215,7 @@ NO_SANITIZE_ALIGNMENT const char *hash_s
+ size_t i;
+ // Check putative match
+ for (i = 0; i < f_len; i++) {
+- if ((case_sensitive ? R[i] : tolower(R[i])) != find[i])
++ if ((case_sensitive ? R[i] : tolower((unsigned char)R[i])) != find[i])
+ goto next_hash_cell;
+ }
+ return R; // Found
+@@ -227,7 +227,7 @@ NO_SANITIZE_ALIGNMENT const char *hash_s
+ size_t i;
+ const char *R = s + s_i;
+ for (i = 0; i < f_len; i++) {
+- char s_c = case_sensitive ? R[i] : tolower(R[i]);
++ char s_c = case_sensitive ? R[i] : tolower((unsigned char)R[i]);
+ if (s_c != find[i])
+ goto next_start;
+ }
+@@ -457,7 +457,7 @@ int is_wordchar(char ch) {
+ int is_lowercase(const char *s) {
+ int i;
+ for (i = 0; s[i] != '\0'; i++) {
+- if (!isascii(s[i]) || isupper(s[i])) {
++ if (!isascii((unsigned char)s[i]) || isupper((unsigned char)s[i])) {
+ return FALSE;
+ }
+ }
Home |
Main Index |
Thread Index |
Old Index