Changeset View
Changeset View
Standalone View
Standalone View
lib/libc/regex/regcomp.c
Show First 20 Lines • Show All 1,600 Lines • ▼ Show 20 Lines | findmust(struct parse *p, struct re_guts *g) | ||||
size_t clen; | size_t clen; | ||||
mbstate_t mbs; | mbstate_t mbs; | ||||
/* avoid making error situations worse */ | /* avoid making error situations worse */ | ||||
if (p->error != 0) | if (p->error != 0) | ||||
return; | return; | ||||
/* | /* | ||||
* It's not generally safe to do a ``char'' substring search on | * It's not safe to do a ``char'' substring search on | ||||
* multibyte character strings, but it's safe for at least | * multibyte character strings. | ||||
* UTF-8 (see RFC 3629). | |||||
*/ | */ | ||||
if (MB_CUR_MAX > 1 && | if (MB_CUR_MAX > 1) | ||||
strcmp(_CurrentRuneLocale->__encoding, "UTF-8") != 0) | |||||
return; | return; | ||||
/* find the longest OCHAR sequence in strip */ | /* find the longest OCHAR sequence in strip */ | ||||
newlen = 0; | newlen = 0; | ||||
offset = 0; | offset = 0; | ||||
g->moffset = 0; | g->moffset = 0; | ||||
scan = g->strip + 1; | scan = g->strip + 1; | ||||
do { | do { | ||||
▲ Show 20 Lines • Show All 365 Lines • Show Last 20 Lines |