summaryrefslogtreecommitdiff
path: root/system/csvutils/fix_i_option.diff
blob: b00c56904f4f9ce4f2f055e9adb655801ae5ecdd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff -Naur csvutils-0.9.3+20161218_e57951b/src/csvgrep.c csvutils-0.9.3+20161218_e57951b.patched/src/csvgrep.c
--- csvutils-0.9.3+20161218_e57951b/src/csvgrep.c	2022-01-26 02:05:12.660602834 -0500
+++ csvutils-0.9.3+20161218_e57951b.patched/src/csvgrep.c	2022-01-26 02:22:34.393508136 -0500
@@ -788,7 +788,7 @@
     #ifdef WITHOUT_PCRE
     err("not compiled with pcre support");
     #else
-    re = pcre_compile(pattern, 0, &err_ptr, &rv, NULL);
+    re = pcre_compile(pattern, (ignore_case ? PCRE_CASELESS : 0), &err_ptr, &rv, NULL);
     if (rv) {
       fprintf(stderr, "Error parsing pattern expression: %s\n", err_ptr);
       exit(EXIT_FAILURE);
@@ -798,7 +798,7 @@
     #ifdef WITHOUT_POSIX
     err("not compiled with posix support");
     #else
-    if ((rv = regcomp(&preg, pattern, REG_EXTENDED | REG_NOSUB )) != 0) {
+    if ((rv = regcomp(&preg, pattern, REG_EXTENDED | REG_NOSUB | (ignore_case ? REG_ICASE : 0))) != 0) {
       regerror(rv, &preg, errbuf, sizeof errbuf);
       fprintf(stderr, "Error parsing pattern expression: %s\n", errbuf);
       exit(EXIT_FAILURE);