]> git.saurik.com Git - apple/libc.git/blob - regex/FreeBSD/regex2.h.patch
fd35a89645aee1d27334effc19487c6ff761dd12
[apple/libc.git] / regex / FreeBSD / regex2.h.patch
1 --- regex2.h.orig 2004-11-25 11:38:32.000000000 -0800
2 +++ regex2.h 2005-02-24 14:26:21.000000000 -0800
3 @@ -127,9 +127,10 @@
4 } cset;
5
6 static int
7 -CHIN1(cs, ch)
8 +CHIN1(cs, ch, loc)
9 cset *cs;
10 wint_t ch;
11 +locale_t loc;
12 {
13 int i;
14
15 @@ -144,15 +145,16 @@
16 if (cs->ranges[i].min <= ch && ch <= cs->ranges[i].max)
17 return (!cs->invert);
18 for (i = 0; i < cs->ntypes; i++)
19 - if (iswctype(ch, cs->types[i]))
20 + if (iswctype_l(ch, cs->types[i], loc))
21 return (!cs->invert);
22 return (cs->invert);
23 }
24
25 static __inline int
26 -CHIN(cs, ch)
27 +CHIN(cs, ch, loc)
28 cset *cs;
29 wint_t ch;
30 +locale_t loc;
31 {
32
33 assert(ch >= 0);
34 @@ -160,10 +162,10 @@
35 return (((cs->bmp[ch >> 3] & (1 << (ch & 7))) != 0) ^
36 cs->invert);
37 else if (cs->icase)
38 - return (CHIN1(cs, ch) || CHIN1(cs, towlower(ch)) ||
39 - CHIN1(cs, towupper(ch)));
40 + return (CHIN1(cs, ch, loc) || CHIN1(cs, towlower_l(ch, loc), loc) ||
41 + CHIN1(cs, towupper_l(ch, loc), loc));
42 else
43 - return (CHIN1(cs, ch));
44 + return (CHIN1(cs, ch, loc));
45 }
46
47 /*
48 @@ -193,8 +195,9 @@
49 size_t nsub; /* copy of re_nsub */
50 int backrefs; /* does it use back references? */
51 sopno nplus; /* how deep does it nest +s? */
52 + locale_t loc; /* current locale */
53 };
54
55 /* misc utilities */
56 #define OUT (-2) /* a non-character value */
57 -#define ISWORD(c) (iswalnum((uch)(c)) || (c) == '_')
58 +#define ISWORD(c,l) (iswalnum_l((uch)(c), l) || (c) == '_')