| 5801 |
#ifdef SUPPORT_UTF8 |
#ifdef SUPPORT_UTF8 |
| 5802 |
if (utf8 && (options & PCRE_NO_UTF8_CHECK) == 0) |
if (utf8 && (options & PCRE_NO_UTF8_CHECK) == 0) |
| 5803 |
{ |
{ |
| 5804 |
if (_pcre_valid_utf8((USPTR)subject, length) >= 0) |
int tb; |
| 5805 |
return PCRE_ERROR_BADUTF8; |
if ((tb = _pcre_valid_utf8((USPTR)subject, length)) >= 0) |
| 5806 |
|
return (tb == length && md->partial > 1)? |
| 5807 |
|
PCRE_ERROR_SHORTUTF8 : PCRE_ERROR_BADUTF8; |
| 5808 |
if (start_offset > 0 && start_offset < length) |
if (start_offset > 0 && start_offset < length) |
| 5809 |
{ |
{ |
| 5810 |
int tb = ((USPTR)subject)[start_offset] & 0xc0; |
tb = ((USPTR)subject)[start_offset] & 0xc0; |
| 5811 |
if (tb == 0x80) return PCRE_ERROR_BADUTF8_OFFSET; |
if (tb == 0x80) return PCRE_ERROR_BADUTF8_OFFSET; |
| 5812 |
} |
} |
| 5813 |
} |
} |