| 277 |
} |
} |
| 278 |
|
|
| 279 |
/* Before running the loop, check for UTF-8 and whether CRLF is a valid newline |
/* Before running the loop, check for UTF-8 and whether CRLF is a valid newline |
| 280 |
sequence. First, find the options with which the regex was compiled; extract |
sequence. First, find the options with which the regex was compiled; extract |
| 281 |
the UTF-8 state, and mask off all but the newline options. */ |
the UTF-8 state, and mask off all but the newline options. */ |
| 282 |
|
|
| 283 |
(void)pcre_fullinfo(re, NULL, PCRE_INFO_OPTIONS, &option_bits); |
(void)pcre_fullinfo(re, NULL, PCRE_INFO_OPTIONS, &option_bits); |
| 303 |
|
|
| 304 |
/* See if CRLF is a valid newline sequence. */ |
/* See if CRLF is a valid newline sequence. */ |
| 305 |
|
|
| 306 |
crlf_is_newline = |
crlf_is_newline = |
| 307 |
option_bits == PCRE_NEWLINE_ANY || |
option_bits == PCRE_NEWLINE_ANY || |
| 308 |
option_bits == PCRE_NEWLINE_CRLF || |
option_bits == PCRE_NEWLINE_CRLF || |
| 309 |
option_bits == PCRE_NEWLINE_ANYCRLF; |
option_bits == PCRE_NEWLINE_ANYCRLF; |
| 362 |
else if (utf8) /* Otherwise, ensure we */ |
else if (utf8) /* Otherwise, ensure we */ |
| 363 |
{ /* advance a whole UTF-8 */ |
{ /* advance a whole UTF-8 */ |
| 364 |
while (ovector[1] < subject_length) /* character. */ |
while (ovector[1] < subject_length) /* character. */ |
| 365 |
{ |
{ |
| 366 |
if ((subject[ovector[1]] & 0xc0) != 0x80) break; |
if ((subject[ovector[1]] & 0xc0) != 0x80) break; |
| 367 |
ovector[1] += 1; |
ovector[1] += 1; |
| 368 |
} |
} |
| 369 |
} |
} |
| 370 |
continue; /* Go round the loop again */ |
continue; /* Go round the loop again */ |
| 371 |
} |
} |
| 372 |
|
|