]> git.pld-linux.org Git - packages/grep.git/blame - grep-match_icase.patch
- rel 3
[packages/grep.git] / grep-match_icase.patch
CommitLineData
e0c0fa61
AM
1This fixes
2 echo Y | LC_ALL=en_US.UTF-8 grep -i '[y]'
3The expected output is:
4 Y
5
6Without this patch, it works on non UTF-8 environment, but fails on UTF-8
7environment.
8
9The definition of RE_ICASE comes from the glibc (/usr/include/regex.h)
10
11Maybe lib/posix/regex.h should be removed to enforce the usage of the
12glibc's regex.h
13
14--- lib/posix/regex.h.orig 2004-01-05 12:09:12.984391131 +0000
15+++ lib/posix/regex.h 2004-01-05 12:09:24.717990622 +0000
16@@ -109,6 +109,10 @@
17 treated as 'a\{1'. */
18 #define RE_INVALID_INTERVAL_ORD (RE_DEBUG << 1)
19
20+/* If this bit is set, then ignore case when matching.
21+ If not set, then case is significant. */
22+#define RE_ICASE (RE_INVALID_INTERVAL_ORD << 1)
23+
24 /* This global variable defines the particular regexp syntax to use (for
25 some interfaces). When a regexp is compiled, the syntax used is
26 stored in the pattern buffer, so changing this does not affect
27--- src/search.c.orig 2005-09-06 23:50:40.000000000 +0200
28+++ src/search.c 2005-09-06 23:59:33.000000000 +0200
29@@ -172,10 +167,8 @@
30 char const *motif = pattern;
31
32 check_utf8 ();
33-#if 0
34 if (match_icase)
35 syntax_bits |= RE_ICASE;
36-#endif
37 re_set_syntax (syntax_bits);
38 dfasyntax (syntax_bits, match_icase, eolbyte);
39
This page took 0.195828 seconds and 4 git commands to generate.