svn commit: r253810 - head/usr.bin/grep/regex
Andrey A. Chernov
ache at FreeBSD.org
Tue Jul 30 18:16:44 UTC 2013
Author: ache
Date: Tue Jul 30 18:16:43 2013
New Revision: 253810
URL: http://svnweb.freebsd.org/changeset/base/253810
Log:
grep -i does not work for simple patterns and single byte locales, like
LANG=ru_RU.KOI8-R grep -i <some single KOI8-R letter>
Fix it.
MFC after: 3 days
Modified:
head/usr.bin/grep/regex/tre-fastmatch.c
Modified: head/usr.bin/grep/regex/tre-fastmatch.c
==============================================================================
--- head/usr.bin/grep/regex/tre-fastmatch.c Tue Jul 30 17:35:06 2013 (r253809)
+++ head/usr.bin/grep/regex/tre-fastmatch.c Tue Jul 30 18:16:43 2013 (r253810)
@@ -395,7 +395,7 @@ static int fastcmp(const fastmatch_t *fg
if (p == NULL) \
return REG_ESPACE; \
for (unsigned int i = 0; i < plen; i++) \
- p[i] = tolower(pat[i]); \
+ p[i] = tolower((unsigned char)pat[i]); \
_CALC_BMGS(arr, p, plen); \
xfree(p); \
} \
@@ -1030,7 +1030,7 @@ fastcmp(const fastmatch_t *fg, const voi
continue;
/* Compare */
- if (fg->icase ? (tolower(pat_byte[i]) == tolower(str_byte[i]))
+ if (fg->icase ? (tolower((unsigned char)pat_byte[i]) == tolower((unsigned char)str_byte[i]))
: (pat_byte[i] == str_byte[i]))
continue;
}
More information about the svn-src-all
mailing list