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
This commit is contained in:
Tim J. Robbins 2005-05-31 12:49:04 +00:00
parent 4a6187f564
commit 10f38d95af
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=146820

View File

@ -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);
}