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
This commit is contained in:
parent
7263f45e6f
commit
f1135552c6
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user