* regex/engine.c (step): Drop Cygwin-specific definition.

(NONCHAR): Better cast here to make the test work.  Move comment
	from step here.
	(matcher): Disable skipping initial string in multibyte case.
	* regex/regcomp.c (p_bracket): Don't simplify singleton in the invert
	case.
	(p_b_term): Handle early end of pattern after dash in bracket
	expression.
	(singleton): Don't ignore the wides just because there's already a
	singleton in the single byte chars.  Fix condition for a singleton
	wide accordingly.
	(findmust): Check for LC_CTYPE charset, rather than LC_COLLATE charset.
	* regex2.h (CHIN): Fix condition in the icase & invert case.
	(ISWORD): Fix wrong cast to unsigned char.
This commit is contained in:
Corinna Vinschen
2010-02-11 21:19:19 +00:00
parent 45c8c6469a
commit 44caccfca2
4 changed files with 42 additions and 22 deletions

View File

@ -151,10 +151,14 @@ CHIN(cset *cs, wint_t ch)
if (ch < NC)
return (((cs->bmp[ch >> 3] & (1 << (ch & 7))) != 0) ^
cs->invert);
else if (cs->icase)
return (CHIN1(cs, ch) || CHIN1(cs, towlower(ch)) ||
CHIN1(cs, towupper(ch)));
else
else if (cs->icase) {
if (cs->invert)
return (CHIN1(cs, ch) && CHIN1(cs, towlower(ch)) &&
CHIN1(cs, towupper(ch)));
else
return (CHIN1(cs, ch) || CHIN1(cs, towlower(ch)) ||
CHIN1(cs, towupper(ch)));
} else
return (CHIN1(cs, ch));
}
@ -189,4 +193,4 @@ struct re_guts {
/* misc utilities */
#define OUT (CHAR_MIN - 1) /* a non-character value */
#define ISWORD(c) (iswalnum((uch)(c)) || (c) == '_')
#define ISWORD(c) (iswalnum((wint_t)(c)) || (c) == '_')