diff options
author | Tim J. Robbins <tjr@FreeBSD.org> | 2005-05-31 12:49:04 +0000 |
---|---|---|
committer | Tim J. Robbins <tjr@FreeBSD.org> | 2005-05-31 12:49:04 +0000 |
commit | 10f38d95afb4be379c6b705feec64782bdc12f2d (patch) | |
tree | 7faaf0e64df33f4b803ac71d4c58dc46ec3b9a98 | |
parent | 4a6187f564cd5e309a253bc06c3b012ce7008e4b (diff) | |
download | src-10f38d95afb4be379c6b705feec64782bdc12f2d.tar.gz src-10f38d95afb4be379c6b705feec64782bdc12f2d.zip |
Pass the RE_ICASE flag to re_set_syntax() as appropriate to fix
case-insensitive matching (-i option) in certain multibyte locales.
Obtained from: Fedora
Notes
Notes:
svn path=/head/; revision=146820
-rw-r--r-- | gnu/usr.bin/grep/search.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gnu/usr.bin/grep/search.c b/gnu/usr.bin/grep/search.c index cf478c509342..1e5769465cf4 100644 --- a/gnu/usr.bin/grep/search.c +++ b/gnu/usr.bin/grep/search.c @@ -169,7 +169,7 @@ Gcompile (char const *pattern, size_t size) char const *motif = pattern; check_utf8 (); - re_set_syntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE); + re_set_syntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE | (match_icase ? RE_ICASE : 0)); dfasyntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE, match_icase, eolbyte); /* For GNU regex compiler we have to pass the patterns separately to detect @@ -248,12 +248,12 @@ Ecompile (char const *pattern, size_t size) check_utf8 (); if (strcmp (matcher, "awk") == 0) { - re_set_syntax (RE_SYNTAX_AWK); + re_set_syntax (RE_SYNTAX_AWK | (match_icase ? RE_ICASE : 0)); dfasyntax (RE_SYNTAX_AWK, match_icase, eolbyte); } else { - re_set_syntax (RE_SYNTAX_POSIX_EGREP); + re_set_syntax (RE_SYNTAX_POSIX_EGREP | (match_icase ? RE_ICASE : 0)); dfasyntax (RE_SYNTAX_POSIX_EGREP, match_icase, eolbyte); } |