summaryrefslogtreecommitdiffstats
path: root/usr.bin/grep
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2013-07-30 18:16:43 +0000
committerache <ache@FreeBSD.org>2013-07-30 18:16:43 +0000
commitd6abb7bc66d6cc78b74c70932177e31feed88a72 (patch)
tree8e0845f6e33d661ed683fb79a08b2421b71386e5 /usr.bin/grep
parent6631781eb931139dbe917aef789bd5c83b149cf4 (diff)
downloadFreeBSD-src-d6abb7bc66d6cc78b74c70932177e31feed88a72.zip
FreeBSD-src-d6abb7bc66d6cc78b74c70932177e31feed88a72.tar.gz
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
Diffstat (limited to 'usr.bin/grep')
-rw-r--r--usr.bin/grep/regex/tre-fastmatch.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/grep/regex/tre-fastmatch.c b/usr.bin/grep/regex/tre-fastmatch.c
index b7a7c91..4b58900 100644
--- a/usr.bin/grep/regex/tre-fastmatch.c
+++ b/usr.bin/grep/regex/tre-fastmatch.c
@@ -395,7 +395,7 @@ static int fastcmp(const fastmatch_t *fg, const void *data,
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 void *data, tre_str_type_t type)
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;
}
OpenPOWER on IntegriCloud