480 |
{ |
{ |
481 |
if (current_subject <= start_subject) break; |
if (current_subject <= start_subject) break; |
482 |
current_subject--; |
current_subject--; |
483 |
while (current_subject > start_subject && |
INTERNALCHAR(current_subject > start_subject, *current_subject, current_subject--); |
|
(*current_subject & 0xc0) == 0x80) |
|
|
current_subject--; |
|
484 |
} |
} |
485 |
} |
} |
486 |
else |
else |
3159 |
return (errorcode <= PCRE_UTF8_ERR5 && (options & PCRE_PARTIAL_HARD) != 0)? |
return (errorcode <= PCRE_UTF8_ERR5 && (options & PCRE_PARTIAL_HARD) != 0)? |
3160 |
PCRE_ERROR_SHORTUTF8 : PCRE_ERROR_BADUTF8; |
PCRE_ERROR_SHORTUTF8 : PCRE_ERROR_BADUTF8; |
3161 |
} |
} |
3162 |
|
#ifdef COMPILE_PCRE8 |
3163 |
if (start_offset > 0 && start_offset < length && |
if (start_offset > 0 && start_offset < length && |
3164 |
(((PCRE_PUCHAR)subject)[start_offset] & 0xc0) == 0x80) |
(((PCRE_PUCHAR)subject)[start_offset] & 0xc0) == 0x80) |
3165 |
return PCRE_ERROR_BADUTF8_OFFSET; |
return PCRE_ERROR_BADUTF8_OFFSET; |
3166 |
|
#else |
3167 |
|
#ifdef COMPILE_PCRE16 |
3168 |
|
if (start_offset > 0 && start_offset < length && |
3169 |
|
(((PCRE_PUCHAR)subject)[start_offset] & 0xfc00) == 0xdc00) |
3170 |
|
return PCRE_ERROR_BADUTF8_OFFSET; |
3171 |
|
#endif /* COMPILE_PCRE16 */ |
3172 |
|
#endif /* COMPILE_PCRE8 */ |
3173 |
} |
} |
3174 |
#endif |
#endif |
3175 |
|
|
3240 |
if (firstline) |
if (firstline) |
3241 |
{ |
{ |
3242 |
PCRE_PUCHAR t = current_subject; |
PCRE_PUCHAR t = current_subject; |
3243 |
#ifdef SUPPORT_UTF8 |
#ifdef SUPPORT_UTF |
3244 |
if (utf) |
if (utf) |
3245 |
{ |
{ |
3246 |
while (t < md->end_subject && !IS_NEWLINE(t)) |
while (t < md->end_subject && !IS_NEWLINE(t)) |
3247 |
{ |
{ |
3248 |
t++; |
t++; |
3249 |
while (t < end_subject && (*t & 0xc0) == 0x80) t++; |
INTERNALCHAR(t < end_subject, *t, t++); |
3250 |
} |
} |
3251 |
} |
} |
3252 |
else |
else |
3283 |
{ |
{ |
3284 |
if (current_subject > md->start_subject + start_offset) |
if (current_subject > md->start_subject + start_offset) |
3285 |
{ |
{ |
3286 |
#ifdef SUPPORT_UTF8 |
#ifdef SUPPORT_UTF |
3287 |
if (utf) |
if (utf) |
3288 |
{ |
{ |
3289 |
while (current_subject < end_subject && |
while (current_subject < end_subject && |
3290 |
!WAS_NEWLINE(current_subject)) |
!WAS_NEWLINE(current_subject)) |
3291 |
{ |
{ |
3292 |
current_subject++; |
current_subject++; |
3293 |
while(current_subject < end_subject && |
INTERNALCHAR(current_subject < end_subject, *current_subject, |
3294 |
(*current_subject & 0xc0) == 0x80) |
current_subject++); |
|
current_subject++; |
|
3295 |
} |
} |
3296 |
} |
} |
3297 |
else |
else |
3321 |
if ((start_bits[c/8] & (1 << (c&7))) == 0) |
if ((start_bits[c/8] & (1 << (c&7))) == 0) |
3322 |
{ |
{ |
3323 |
current_subject++; |
current_subject++; |
3324 |
#ifdef SUPPORT_UTF8 |
#ifdef SUPPORT_UTF |
3325 |
if (utf) |
if (utf) |
3326 |
while(current_subject < end_subject && |
INTERNALCHAR(current_subject < end_subject, *current_subject, |
3327 |
(*current_subject & 0xc0) == 0x80) current_subject++; |
current_subject++); |
3328 |
#endif |
#endif |
3329 |
} |
} |
3330 |
else break; |
else break; |
3431 |
|
|
3432 |
if (firstline && IS_NEWLINE(current_subject)) break; |
if (firstline && IS_NEWLINE(current_subject)) break; |
3433 |
current_subject++; |
current_subject++; |
3434 |
|
#ifdef SUPPORT_UTF |
3435 |
if (utf) |
if (utf) |
3436 |
{ |
{ |
3437 |
while (current_subject < end_subject && (*current_subject & 0xc0) == 0x80) |
INTERNALCHAR(current_subject < end_subject, *current_subject, |
3438 |
current_subject++; |
current_subject++); |
3439 |
} |
} |
3440 |
|
#endif |
3441 |
if (current_subject > end_subject) break; |
if (current_subject > end_subject) break; |
3442 |
|
|
3443 |
/* If we have just passed a CR and we are now at a LF, and the pattern does |
/* If we have just passed a CR and we are now at a LF, and the pattern does |