Revision: 713
http://vcs.pcre.org/viewvc?view=rev&revision=713
Author: ph10
Date: 2011-09-27 12:03:15 +0100 (Tue, 27 Sep 2011)
Log Message:
-----------
Fix bug with (*THEN) in a subroutine/recursion.
Modified Paths:
--------------
code/trunk/ChangeLog
code/trunk/pcre_exec.c
code/trunk/testdata/testinput2
code/trunk/testdata/testoutput2
Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog 2011-09-26 16:31:42 UTC (rev 712)
+++ code/trunk/ChangeLog 2011-09-27 11:03:15 UTC (rev 713)
@@ -72,6 +72,9 @@
13. RunTest now checks for the "fr" locale as well as for "fr_FR" and "french".
For "fr", it uses the Windows-specific input and output files.
+
+14. If (*THEN) appeared in a group that was called recursively or as a
+ subroutine, it did not work as intended.
Version 8.13 16-Aug-2011
Modified: code/trunk/pcre_exec.c
===================================================================
--- code/trunk/pcre_exec.c 2011-09-26 16:31:42 UTC (rev 712)
+++ code/trunk/pcre_exec.c 2011-09-27 11:03:15 UTC (rev 713)
@@ -1615,7 +1615,7 @@
goto RECURSION_MATCHED; /* Exit loop; end processing */
}
else if (rrc != MATCH_NOMATCH &&
- (rrc != MATCH_THEN || md->start_match_ptr != ecode))
+ (rrc != MATCH_THEN || md->start_match_ptr != callpat))
{
DPRINTF(("Recursion gave error %d\n", rrc));
if (new_recursive.offset_save != stacksave)
Modified: code/trunk/testdata/testinput2
===================================================================
--- code/trunk/testdata/testinput2 2011-09-26 16:31:42 UTC (rev 712)
+++ code/trunk/testdata/testinput2 2011-09-27 11:03:15 UTC (rev 713)
@@ -3741,6 +3741,9 @@
/^.*?(a(*THEN)b)c/
aabc
+
+/^.*? (?1) c (?(DEFINE)(a(*THEN)b))/x
+ aabc
/^.*?(a(*THEN)b|z)c/
aabc
Modified: code/trunk/testdata/testoutput2
===================================================================
--- code/trunk/testdata/testoutput2 2011-09-26 16:31:42 UTC (rev 712)
+++ code/trunk/testdata/testoutput2 2011-09-27 11:03:15 UTC (rev 713)
@@ -11842,6 +11842,10 @@
aabc
0: aabc
1: ab
+
+/^.*? (?1) c (?(DEFINE)(a(*THEN)b))/x
+ aabc
+ 0: aabc
/^.*?(a(*THEN)b|z)c/
aabc