1 --- regex2.h.bsdnew 2009-11-11 11:29:04.000000000 -0800
2 +++ regex2.h 2009-11-11 12:18:35.000000000 -0800
3 @@ -120,14 +120,23 @@ typedef struct {
14 -CHIN1(cset *cs, wint_t ch)
15 +CHIN1(cset *cs, wint_t ch, locale_t loc)
20 + for (i = 0; i < cs->nequiv_classes; i++)
21 + /* sadly, we can only deal with single characters from an
22 + * equivalence class */
23 + if (__collate_equiv_match(cs->equiv_classes[i], NULL, 0, ch, NULL, 0, NULL, NULL, loc) > 0)
24 + return (!cs->invert);
26 return (((cs->bmp[ch >> 3] & (1 << (ch & 7))) != 0) ^
28 @@ -138,24 +147,24 @@ CHIN1(cset *cs, wint_t ch)
29 if (cs->ranges[i].min <= ch && ch <= cs->ranges[i].max)
31 for (i = 0; i < cs->ntypes; i++)
32 - if (iswctype(ch, cs->types[i]))
33 + if (iswctype_l(ch, cs->types[i], loc))
39 -CHIN(cset *cs, wint_t ch)
40 +CHIN(cset *cs, wint_t ch, locale_t loc)
45 + if (ch < NC && cs->nequiv_classes == 0)
46 return (((cs->bmp[ch >> 3] & (1 << (ch & 7))) != 0) ^
49 - return (CHIN1(cs, ch) || CHIN1(cs, towlower(ch)) ||
50 - CHIN1(cs, towupper(ch)));
51 + return (CHIN1(cs, ch, loc) || CHIN1(cs, towlower_l(ch, loc), loc) ||
52 + CHIN1(cs, towupper_l(ch, loc), loc));
54 - return (CHIN1(cs, ch));
55 + return (CHIN1(cs, ch, loc));
59 @@ -185,8 +194,9 @@ struct re_guts {
60 size_t nsub; /* copy of re_nsub */
61 int backrefs; /* does it use back references? */
62 sopno nplus; /* how deep does it nest +s? */
63 + locale_t loc; /* current locale */
67 -#define OUT (CHAR_MIN - 1) /* a non-character value */
68 -#define ISWORD(c) (iswalnum((uch)(c)) || (c) == '_')
69 +#define OUT (CHAR_MIN - 2) /* a non-character value */
70 +#define ISWORD(c,l) (iswalnum_l((uch)(c), l) || (c) == '_')