sys-apps/grep: import
[portage-prefix-bleeding-edge-ebuilds.git] / sys-apps / grep / files / grep-2.5.1-oi.patch
blob563c8372322e924110711b19d7ff202656512214
1 Ripped from Fedora
3 --- grep-2.5.1/lib/posix/regex.h.oi 2004-01-05 12:09:12.984391131 +0000
4 +++ grep-2.5.1/lib/posix/regex.h 2004-01-05 12:09:24.717990622 +0000
5 @@ -109,6 +109,10 @@
6 If not set, \{, \}, {, and } are literals. */
7 #define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1)
9 +/* If this bit is set, then ignore case when matching.
10 + If not set, then case is significant. */
11 +#define RE_ICASE (RE_INVALID_INTERVAL_ORD << 1)
13 /* If this bit is set, +, ? and | aren't recognized as operators.
14 If not set, they are. */
15 #define RE_LIMITED_OPS (RE_INTERVALS << 1)
16 --- grep-2.5.1/src/search.c.oi 2004-01-05 12:07:00.550199415 +0000
17 +++ grep-2.5.1/src/search.c 2004-01-05 12:07:00.566197505 +0000
18 @@ -31,7 +31,7 @@
20 #include "system.h"
21 #include "grep.h"
22 -#include "regex.h"
23 +#include <regex.h>
24 #include "dfa.h"
25 #include "kwset.h"
26 #include "error.h"
27 @@ -190,7 +190,7 @@
28 size_t total = size;
29 char const *motif = pattern;
31 - re_set_syntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE);
32 + re_set_syntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE | (match_icase ? RE_ICASE : 0));
33 dfasyntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE, match_icase, eolbyte);
35 /* For GNU regex compiler we have to pass the patterns separately to detect
36 @@ -268,12 +268,12 @@
38 if (strcmp (matcher, "awk") == 0)
40 - re_set_syntax (RE_SYNTAX_AWK);
41 + re_set_syntax (RE_SYNTAX_AWK | (match_icase ? RE_ICASE : 0));
42 dfasyntax (RE_SYNTAX_AWK, match_icase, eolbyte);
44 else
46 - re_set_syntax (RE_SYNTAX_POSIX_EGREP);
47 + re_set_syntax (RE_SYNTAX_POSIX_EGREP | (match_icase ? RE_ICASE : 0));
48 dfasyntax (RE_SYNTAX_POSIX_EGREP, match_icase, eolbyte);