Revision: 610
http://vcs.pcre.org/viewvc?view=rev&revision=610
Author: ph10
Date: 2011-06-28 16:58:34 +0100 (Tue, 28 Jun 2011)
Log Message:
-----------
Fixed newly introduced bug for patterns like /(?:(b))++/, where the capturing
was happening, but not setting the correct return code.
Modified Paths:
--------------
code/trunk/pcre_exec.c
code/trunk/testdata/testinput11
code/trunk/testdata/testoutput11
Modified: code/trunk/pcre_exec.c
===================================================================
--- code/trunk/pcre_exec.c 2011-06-15 18:09:23 UTC (rev 609)
+++ code/trunk/pcre_exec.c 2011-06-28 15:58:34 UTC (rev 610)
@@ -966,7 +966,7 @@
ecode += GET(ecode, 1);
if (*ecode != OP_ALT) break;
}
-
+
if (!matched_once)
{
md->offset_vector[offset] = save_offset1;
@@ -1015,6 +1015,7 @@
eptrb, RM48);
if (rrc == MATCH_KETRPOS)
{
+ offset_top = md->end_offset_top;
eptr = md->end_match_ptr;
ecode = md->start_code + code_offset;
matched_once = TRUE;
@@ -1026,7 +1027,7 @@
ecode += GET(ecode, 1);
if (*ecode != OP_ALT) break;
}
-
+
if (matched_once || allow_zero)
{
ecode += 1 + LINK_SIZE;
Modified: code/trunk/testdata/testinput11
===================================================================
--- code/trunk/testdata/testinput11 2011-06-15 18:09:23 UTC (rev 609)
+++ code/trunk/testdata/testinput11 2011-06-28 15:58:34 UTC (rev 610)
@@ -623,4 +623,7 @@
/\A.*?(?:a|bc|d)/
ba
+/(?:(b))++/
+ beetle
+
/-- End of testinput11 --/
Modified: code/trunk/testdata/testoutput11
===================================================================
--- code/trunk/testdata/testoutput11 2011-06-15 18:09:23 UTC (rev 609)
+++ code/trunk/testdata/testoutput11 2011-06-28 15:58:34 UTC (rev 610)
@@ -1186,4 +1186,9 @@
ba
0: ba
+/(?:(b))++/
+ beetle
+ 0: b
+ 1: b
+
/-- End of testinput11 --/