diff options
author | tjr <tjr@FreeBSD.org> | 2005-05-31 12:49:04 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2005-05-31 12:49:04 +0000 |
commit | 4f902fd54519e2ce39b5417c8704d9e6e64a579f (patch) | |
tree | 7faaf0e64df33f4b803ac71d4c58dc46ec3b9a98 /gnu | |
parent | 1f239ec28c1459d7a1b97ffc2e421b71255304d6 (diff) | |
download | FreeBSD-src-4f902fd54519e2ce39b5417c8704d9e6e64a579f.zip FreeBSD-src-4f902fd54519e2ce39b5417c8704d9e6e64a579f.tar.gz |
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
Diffstat (limited to 'gnu')
-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 cf478c5..1e57694 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); } |