|
Lines 281-294
Link Here
|
| 281 |
pmatch.rm_so = st; |
281 |
pmatch.rm_so = st; |
| 282 |
pmatch.rm_eo = l->len; |
282 |
pmatch.rm_eo = l->len; |
| 283 |
|
283 |
|
|
|
284 |
/* Position-adjusted eflags, if we are beyond the first |
| 285 |
character, we have to set REG_NOTBOL to ensure that |
| 286 |
anchors are handled correctly. */ |
| 287 |
int peflags = eflags | (st == 0 ? 0 : REG_NOTBOL); |
| 288 |
|
| 284 |
/* Loop to compare with all the patterns */ |
289 |
/* Loop to compare with all the patterns */ |
| 285 |
for (i = 0; i < patterns; i++) { |
290 |
for (i = 0; i < patterns; i++) { |
| 286 |
if (fg_pattern[i].pattern) |
291 |
if (fg_pattern[i].pattern) |
| 287 |
r = fastexec(&fg_pattern[i], |
292 |
r = fastexec(&fg_pattern[i], |
| 288 |
l->dat, 1, &pmatch, eflags); |
293 |
l->dat, 1, &pmatch, peflags); |
| 289 |
else |
294 |
else |
| 290 |
r = regexec(&r_pattern[i], l->dat, 1, |
295 |
r = regexec(&r_pattern[i], l->dat, 1, |
| 291 |
&pmatch, eflags); |
296 |
&pmatch, peflags); |
| 292 |
r = (r == 0) ? 0 : REG_NOMATCH; |
297 |
r = (r == 0) ? 0 : REG_NOMATCH; |
| 293 |
st = (cflags & REG_NOSUB) |
298 |
st = (cflags & REG_NOSUB) |
| 294 |
? (size_t)l->len |
299 |
? (size_t)l->len |