summaryrefslogtreecommitdiff
path: root/pcre_exec.c
diff options
context:
space:
mode:
authorph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2013-03-22 16:13:13 +0000
committerph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2013-03-22 16:13:13 +0000
commit712f2578028ec79534921d1b06f7b9d0fa1e643b (patch)
tree210216515dd0488a595b09cbe3b12bc2353f5645 /pcre_exec.c
parent54b46b0215cca9f79390afab565a31db76372d74 (diff)
downloadpcre-712f2578028ec79534921d1b06f7b9d0fa1e643b.tar.gz
Fix COMMIT in recursion; document backtracking verbs in assertions and
subroutines. git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1298 2f5784b3-3f2a-0410-8824-cb99058d5e15
Diffstat (limited to 'pcre_exec.c')
-rw-r--r--pcre_exec.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/pcre_exec.c b/pcre_exec.c
index bcc2c63..79c14db 100644
--- a/pcre_exec.c
+++ b/pcre_exec.c
@@ -1863,11 +1863,15 @@ for (;;)
}
/* PCRE does not allow THEN, SKIP, PRUNE or COMMIT to escape beyond a
- recursion; they are treated as NOMATCH. These codes are defined in a
- range that can be tested for. Any other return code is an error. */
+ recursion; they cause a NOMATCH for the entire recursion. These codes
+ are defined in a range that can be tested for. */
+
+ if (rrc >= MATCH_BACKTRACK_MIN && rrc <= MATCH_BACKTRACK_MAX)
+ RRETURN(MATCH_NOMATCH);
+
+ /* Any return code other than NOMATCH is an error. */
- else if (rrc != MATCH_NOMATCH &&
- (rrc < MATCH_BACKTRACK_MIN || rrc > MATCH_BACKTRACK_MAX))
+ if (rrc != MATCH_NOMATCH)
{
DPRINTF(("Recursion gave error %d\n", rrc));
if (new_recursive.offset_save != stacksave)