2220 |
advance of one character just passes the \r, whereas we should prefer the |
advance of one character just passes the \r, whereas we should prefer the |
2221 |
longer newline sequence, as does the code in pcre_exec(). Fudge the |
longer newline sequence, as does the code in pcre_exec(). Fudge the |
2222 |
offset value to achieve this. |
offset value to achieve this. |
2223 |
|
|
2224 |
Otherwise, in the case of UTF-8 matching, the advance must be one |
Otherwise, in the case of UTF-8 matching, the advance must be one |
2225 |
character, not one byte. */ |
character, not one byte. */ |
2226 |
|
|
2230 |
{ |
{ |
2231 |
int onechar = 1; |
int onechar = 1; |
2232 |
use_offsets[0] = start_offset; |
use_offsets[0] = start_offset; |
2233 |
if ((((real_pcre *)re)->options & PCRE_NEWLINE_BITS) == |
if ((((real_pcre *)re)->options & PCRE_NEWLINE_BITS) == |
2234 |
PCRE_NEWLINE_ANY && |
PCRE_NEWLINE_ANY && |
2235 |
start_offset < len - 1 && |
start_offset < len - 1 && |
2236 |
bptr[start_offset] == '\r' && |
bptr[start_offset] == '\r' && |
2237 |
bptr[start_offset+1] == '\n') |
bptr[start_offset+1] == '\n') |
2238 |
onechar++; |
onechar++; |
2239 |
else if (use_utf8) |
else if (use_utf8) |
2240 |
{ |
{ |
2241 |
while (start_offset + onechar < len) |
while (start_offset + onechar < len) |