diff options
author | ph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069> | 2016-10-02 16:01:01 +0000 |
---|---|---|
committer | ph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069> | 2016-10-02 16:01:01 +0000 |
commit | c22979ba3394fd75ae70dad34c67ebd19a50bf79 (patch) | |
tree | 65714e8410c56464a95d28415ff42fc55bce8356 /src/pcre2_substitute.c | |
parent | 143f7f5c4dabd978117d415d2016c7595a7b9867 (diff) | |
download | pcre2-c22979ba3394fd75ae70dad34c67ebd19a50bf79.tar.gz |
Major refactoring of pcre2_compile.c; see ChangeLog and HACKING.
git-svn-id: svn://vcs.exim.org/pcre2/code/trunk@555 6239d852-aaf2-0410-a92c-79f79f948069
Diffstat (limited to 'src/pcre2_substitute.c')
-rw-r--r-- | src/pcre2_substitute.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/pcre2_substitute.c b/src/pcre2_substitute.c index 0bf781e..d832da8 100644 --- a/src/pcre2_substitute.c +++ b/src/pcre2_substitute.c @@ -114,7 +114,7 @@ for (; ptr < ptrend; ptr++) else if (*ptr == CHAR_BACKSLASH) { int erc; - int errorcode = 0; + int errorcode; uint32_t ch; if (ptr < ptrend - 1) switch (ptr[1]) @@ -127,8 +127,10 @@ for (; ptr < ptrend; ptr++) continue; } + ptr += 1; /* Must point after \ */ erc = PRIV(check_escape)(&ptr, ptrend, &ch, &errorcode, code->overall_options, FALSE, NULL); + ptr -= 1; /* Back to last code unit of escape */ if (errorcode != 0) { rc = errorcode; @@ -698,7 +700,7 @@ do else if ((suboptions & PCRE2_SUBSTITUTE_EXTENDED) != 0 && *ptr == CHAR_BACKSLASH) { - int errorcode = 0; + int errorcode; if (ptr < repend - 1) switch (ptr[1]) { @@ -728,10 +730,10 @@ do break; } + ptr++; /* Point after \ */ rc = PRIV(check_escape)(&ptr, repend, &ch, &errorcode, code->overall_options, FALSE, NULL); if (errorcode != 0) goto BADESCAPE; - ptr++; switch(rc) { |