Use PCRE2_NO_UTF_CHECK for the second and subsequent matches in

pcre2_substitute().
This commit is contained in:
Philip.Hazel 2015-10-30 17:41:56 +00:00
parent efccea98f1
commit 890250535b
2 changed files with 7 additions and 0 deletions

View File

@ -233,6 +233,9 @@ misbehave.
replacement string was happening before the length setting when the replacement replacement string was happening before the length setting when the replacement
string was zero-terminated. string was zero-terminated.
68. In pcre2_substitute() in UTF mode, PCRE2_NO_UTF_CHECK can be set for the
second and subsequent calls to pcre2_match().
Version 10.20 30-June-2015 Version 10.20 30-June-2015
-------------------------- --------------------------

View File

@ -280,6 +280,10 @@ do
rc = pcre2_match(code, subject, length, start_offset, options|goptions, rc = pcre2_match(code, subject, length, start_offset, options|goptions,
match_data, mcontext); match_data, mcontext);
#ifdef SUPPORT_UNICODE
if (utf) options |= PCRE2_NO_UTF_CHECK; /* Only need to check once */
#endif
/* Any error other than no match returns the error code. No match when not /* Any error other than no match returns the error code. No match when not
doing the special after-empty-match global rematch, or when at the end of the doing the special after-empty-match global rematch, or when at the end of the
subject, breaks the global loop. Otherwise, advance the starting point by one subject, breaks the global loop. Otherwise, advance the starting point by one