]> git.saurik.com Git - apple/libc.git/blob - regex/FreeBSD/engine.c.patch
Libc-391.tar.gz
[apple/libc.git] / regex / FreeBSD / engine.c.patch
1 --- engine.c.orig 2004-11-25 11:38:32.000000000 -0800
2 +++ engine.c 2005-02-24 14:25:22.000000000 -0800
3 @@ -270,7 +270,7 @@
4 break;
5 assert(m->coldp < m->endp);
6 m->coldp += XMBRTOWC(NULL, m->coldp,
7 - m->endp - m->coldp, &m->mbs, 0);
8 + m->endp - m->coldp, &m->mbs, 0, g->loc);
9 }
10 if (nmatch == 1 && !g->backrefs)
11 break; /* no further info needed */
12 @@ -331,7 +331,7 @@
13 NOTE("false alarm");
14 /* recycle starting later */
15 start = m->coldp + XMBRTOWC(NULL, m->coldp,
16 - m->endp - m->coldp, &m->mbs, 0);
17 + m->endp - m->coldp, &m->mbs, 0, g->loc);
18 assert(start <= stop);
19 }
20
21 @@ -409,7 +409,7 @@
22 assert(nope);
23 break;
24 case OCHAR:
25 - sp += XMBRTOWC(NULL, sp, stop - start, &m->mbs, 0);
26 + sp += XMBRTOWC(NULL, sp, stop - start, &m->mbs, 0, m->g->loc);
27 break;
28 case OBOL:
29 case OEOL:
30 @@ -418,7 +418,7 @@
31 break;
32 case OANY:
33 case OANYOF:
34 - sp += XMBRTOWC(NULL, sp, stop - start, &m->mbs, 0);
35 + sp += XMBRTOWC(NULL, sp, stop - start, &m->mbs, 0, m->g->loc);
36 break;
37 case OBACK_:
38 case O_BACK:
39 @@ -585,14 +585,14 @@
40 case OCHAR:
41 if (sp == stop)
42 return(NULL);
43 - sp += XMBRTOWC(&wc, sp, stop - sp, &m->mbs, BADCHAR);
44 + sp += XMBRTOWC(&wc, sp, stop - sp, &m->mbs, BADCHAR, m->g->loc);
45 if (wc != OPND(s))
46 return(NULL);
47 break;
48 case OANY:
49 if (sp == stop)
50 return(NULL);
51 - sp += XMBRTOWC(&wc, sp, stop - sp, &m->mbs, BADCHAR);
52 + sp += XMBRTOWC(&wc, sp, stop - sp, &m->mbs, BADCHAR, m->g->loc);
53 if (wc == BADCHAR)
54 return (NULL);
55 break;
56 @@ -600,8 +600,8 @@
57 if (sp == stop)
58 return (NULL);
59 cs = &m->g->sets[OPND(s)];
60 - sp += XMBRTOWC(&wc, sp, stop - sp, &m->mbs, BADCHAR);
61 - if (wc == BADCHAR || !CHIN(cs, wc))
62 + sp += XMBRTOWC(&wc, sp, stop - sp, &m->mbs, BADCHAR, m->g->loc);
63 + if (wc == BADCHAR || !CHIN(cs, wc, m->g->loc))
64 return(NULL);
65 break;
66 case OBOL:
67 @@ -625,8 +625,8 @@
68 (sp < m->endp && *(sp-1) == '\n' &&
69 (m->g->cflags&REG_NEWLINE)) ||
70 (sp > m->beginp &&
71 - !ISWORD(*(sp-1))) ) &&
72 - (sp < m->endp && ISWORD(*sp)) )
73 + !ISWORD(*(sp-1), m->g->loc)) ) &&
74 + (sp < m->endp && ISWORD(*sp, m->g->loc)) )
75 { /* yes */ }
76 else
77 return(NULL);
78 @@ -635,8 +635,8 @@
79 if (( (sp == m->endp && !(m->eflags&REG_NOTEOL)) ||
80 (sp < m->endp && *sp == '\n' &&
81 (m->g->cflags&REG_NEWLINE)) ||
82 - (sp < m->endp && !ISWORD(*sp)) ) &&
83 - (sp > m->beginp && ISWORD(*(sp-1))) )
84 + (sp < m->endp && !ISWORD(*sp, m->g->loc)) ) &&
85 + (sp > m->beginp && ISWORD(*(sp-1), m->g->loc)) )
86 { /* yes */ }
87 else
88 return(NULL);
89 @@ -807,7 +807,7 @@
90 if (p == m->endp)
91 c = OUT;
92 else
93 - clen = XMBRTOWC(&c, p, m->endp - p, &m->mbs, BADCHAR);
94 + clen = XMBRTOWC(&c, p, m->endp - p, &m->mbs, BADCHAR, m->g->loc);
95 if (EQ(st, fresh))
96 coldp = p;
97
98 @@ -831,12 +831,12 @@
99 }
100
101 /* how about a word boundary? */
102 - if ( (flagch == BOL || (lastc != OUT && !ISWORD(lastc))) &&
103 - (c != OUT && ISWORD(c)) ) {
104 + if ( (flagch == BOL || (lastc != OUT && !ISWORD(lastc, m->g->loc))) &&
105 + (c != OUT && ISWORD(c, m->g->loc)) ) {
106 flagch = BOW;
107 }
108 - if ( (lastc != OUT && ISWORD(lastc)) &&
109 - (flagch == EOL || (c != OUT && !ISWORD(c))) ) {
110 + if ( (lastc != OUT && ISWORD(lastc, m->g->loc)) &&
111 + (flagch == EOL || (c != OUT && !ISWORD(c, m->g->loc))) ) {
112 flagch = EOW;
113 }
114 if (flagch == BOW || flagch == EOW) {
115 @@ -861,7 +861,7 @@
116 assert(coldp != NULL);
117 m->coldp = coldp;
118 if (ISSET(st, stopst))
119 - return(p+XMBRTOWC(NULL, p, m->endp - p, &m->mbs, 0));
120 + return(p+XMBRTOWC(NULL, p, m->endp - p, &m->mbs, 0, m->g->loc));
121 else
122 return(NULL);
123 }
124 @@ -913,7 +913,7 @@
125 c = OUT;
126 clen = 0;
127 } else
128 - clen = XMBRTOWC(&c, p, m->endp - p, &m->mbs, BADCHAR);
129 + clen = XMBRTOWC(&c, p, m->endp - p, &m->mbs, BADCHAR, m->g->loc);
130
131 /* is there an EOL and/or BOL between lastc and c? */
132 flagch = '\0';
133 @@ -935,12 +935,12 @@
134 }
135
136 /* how about a word boundary? */
137 - if ( (flagch == BOL || (lastc != OUT && !ISWORD(lastc))) &&
138 - (c != OUT && ISWORD(c)) ) {
139 + if ( (flagch == BOL || (lastc != OUT && !ISWORD(lastc, m->g->loc))) &&
140 + (c != OUT && ISWORD(c, m->g->loc)) ) {
141 flagch = BOW;
142 }
143 - if ( (lastc != OUT && ISWORD(lastc)) &&
144 - (flagch == EOL || (c != OUT && !ISWORD(c))) ) {
145 + if ( (lastc != OUT && ISWORD(lastc, m->g->loc)) &&
146 + (flagch == EOL || (c != OUT && !ISWORD(c, m->g->loc))) ) {
147 flagch = EOW;
148 }
149 if (flagch == BOW || flagch == EOW) {
150 @@ -1031,7 +1031,7 @@
151 break;
152 case OANYOF:
153 cs = &g->sets[OPND(s)];
154 - if (!NONCHAR(ch) && CHIN(cs, ch))
155 + if (!NONCHAR(ch) && CHIN(cs, ch, g->loc))
156 FWD(aft, bef, 1);
157 break;
158 case OBACK_: /* ignored here */