1 --- engine.c.orig 2004-11-25 11:38:32.000000000 -0800
2 +++ engine.c 2005-04-18 16:52:09.000000000 -0700
3 @@ -270,7 +270,7 @@ int eflags;
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);
10 if (nmatch == 1 && !g->backrefs)
11 break; /* no further info needed */
12 @@ -331,7 +331,7 @@ int eflags;
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);
21 @@ -409,7 +409,7 @@ sopno stopst;
25 - sp += XMBRTOWC(NULL, sp, stop - start, &m->mbs, 0);
26 + sp += XMBRTOWC(NULL, sp, stop - start, &m->mbs, 0, m->g->loc);
30 @@ -418,7 +418,7 @@ sopno stopst;
34 - sp += XMBRTOWC(NULL, sp, stop - start, &m->mbs, 0);
35 + sp += XMBRTOWC(NULL, sp, stop - start, &m->mbs, 0, m->g->loc);
39 @@ -479,6 +479,10 @@ sopno stopst;
43 + else if (tail==rest) {
44 + /* Fix for test expr 105 */
47 assert(sep == rest); /* must exhaust substring */
48 assert(slow(m, ssp, sep, ssub, esub) == rest);
49 dp = dissect(m, ssp, sep, ssub, esub);
50 @@ -531,6 +535,14 @@ sopno stopst;
51 i = OPND(m->g->strip[ss]);
52 assert(0 < i && i <= m->g->nsub);
53 m->pmatch[i].rm_so = sp - m->offp;
54 + /* fix for T.regcomp 43: don't remember previous
55 + subexpression matches beyond the current one (i) */
57 + while (i<= m->g->nsub) {
58 + m->pmatch[i].rm_so = -1;
59 + m->pmatch[i].rm_eo = -1;
64 i = OPND(m->g->strip[ss]);
65 @@ -585,14 +597,14 @@ sopno lev; /* PLUS nesting level */
69 - sp += XMBRTOWC(&wc, sp, stop - sp, &m->mbs, BADCHAR);
70 + sp += XMBRTOWC(&wc, sp, stop - sp, &m->mbs, BADCHAR, m->g->loc);
77 - sp += XMBRTOWC(&wc, sp, stop - sp, &m->mbs, BADCHAR);
78 + sp += XMBRTOWC(&wc, sp, stop - sp, &m->mbs, BADCHAR, m->g->loc);
82 @@ -600,8 +612,8 @@ sopno lev; /* PLUS nesting level */
85 cs = &m->g->sets[OPND(s)];
86 - sp += XMBRTOWC(&wc, sp, stop - sp, &m->mbs, BADCHAR);
87 - if (wc == BADCHAR || !CHIN(cs, wc))
88 + sp += XMBRTOWC(&wc, sp, stop - sp, &m->mbs, BADCHAR, m->g->loc);
89 + if (wc == BADCHAR || !CHIN(cs, wc, m->g->loc))
93 @@ -625,8 +637,8 @@ sopno lev; /* PLUS nesting level */
94 (sp < m->endp && *(sp-1) == '\n' &&
95 (m->g->cflags®_NEWLINE)) ||
97 - !ISWORD(*(sp-1))) ) &&
98 - (sp < m->endp && ISWORD(*sp)) )
99 + !ISWORD(*(sp-1), m->g->loc)) ) &&
100 + (sp < m->endp && ISWORD(*sp, m->g->loc)) )
104 @@ -635,8 +647,8 @@ sopno lev; /* PLUS nesting level */
105 if (( (sp == m->endp && !(m->eflags®_NOTEOL)) ||
106 (sp < m->endp && *sp == '\n' &&
107 (m->g->cflags®_NEWLINE)) ||
108 - (sp < m->endp && !ISWORD(*sp)) ) &&
109 - (sp > m->beginp && ISWORD(*(sp-1))) )
110 + (sp < m->endp && !ISWORD(*sp, m->g->loc)) ) &&
111 + (sp > m->beginp && ISWORD(*(sp-1), m->g->loc)) )
115 @@ -807,7 +819,7 @@ sopno stopst;
119 - clen = XMBRTOWC(&c, p, m->endp - p, &m->mbs, BADCHAR);
120 + clen = XMBRTOWC(&c, p, m->endp - p, &m->mbs, BADCHAR, m->g->loc);
124 @@ -831,12 +843,12 @@ sopno stopst;
127 /* how about a word boundary? */
128 - if ( (flagch == BOL || (lastc != OUT && !ISWORD(lastc))) &&
129 - (c != OUT && ISWORD(c)) ) {
130 + if ( (flagch == BOL || (lastc != OUT && !ISWORD(lastc, m->g->loc))) &&
131 + (c != OUT && ISWORD(c, m->g->loc)) ) {
134 - if ( (lastc != OUT && ISWORD(lastc)) &&
135 - (flagch == EOL || (c != OUT && !ISWORD(c))) ) {
136 + if ( (lastc != OUT && ISWORD(lastc, m->g->loc)) &&
137 + (flagch == EOL || (c != OUT && !ISWORD(c, m->g->loc))) ) {
140 if (flagch == BOW || flagch == EOW) {
141 @@ -861,7 +873,7 @@ sopno stopst;
142 assert(coldp != NULL);
144 if (ISSET(st, stopst))
145 - return(p+XMBRTOWC(NULL, p, m->endp - p, &m->mbs, 0));
146 + return(p+XMBRTOWC(NULL, p, m->endp - p, &m->mbs, 0, m->g->loc));
150 @@ -913,7 +925,7 @@ sopno stopst;
154 - clen = XMBRTOWC(&c, p, m->endp - p, &m->mbs, BADCHAR);
155 + clen = XMBRTOWC(&c, p, m->endp - p, &m->mbs, BADCHAR, m->g->loc);
157 /* is there an EOL and/or BOL between lastc and c? */
159 @@ -935,12 +947,12 @@ sopno stopst;
162 /* how about a word boundary? */
163 - if ( (flagch == BOL || (lastc != OUT && !ISWORD(lastc))) &&
164 - (c != OUT && ISWORD(c)) ) {
165 + if ( (flagch == BOL || (lastc != OUT && !ISWORD(lastc, m->g->loc))) &&
166 + (c != OUT && ISWORD(c, m->g->loc)) ) {
169 - if ( (lastc != OUT && ISWORD(lastc)) &&
170 - (flagch == EOL || (c != OUT && !ISWORD(c))) ) {
171 + if ( (lastc != OUT && ISWORD(lastc, m->g->loc)) &&
172 + (flagch == EOL || (c != OUT && !ISWORD(c, m->g->loc))) ) {
175 if (flagch == BOW || flagch == EOW) {
176 @@ -1031,7 +1043,7 @@ states aft; /* states already known re
179 cs = &g->sets[OPND(s)];
180 - if (!NONCHAR(ch) && CHIN(cs, ch))
181 + if (!NONCHAR(ch) && CHIN(cs, ch, g->loc))
184 case OBACK_: /* ignored here */