From 10f38d95afb4be379c6b705feec64782bdc12f2d Mon Sep 17 00:00:00 2001 From: "Tim J. Robbins" Date: Tue, 31 May 2005 12:49:04 +0000 Subject: [PATCH] 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 --- gnu/usr.bin/grep/search.c | 6 +++--- 1 file 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); }