70 lines
1.9 KiB
Diff
70 lines
1.9 KiB
Diff
Fix repeated forward reference needed character bug
|
|
|
|
From:
|
|
r762 | ph10 | 2011-11-22 14:36:51 +0100 (Út, 22 lis 2011) | 2 lines
|
|
|
|
16. A repeated forward reference in a pattern such as (a)(?2){2}(.) was
|
|
incorrectly expecting the subject to contain another "a" after the start.
|
|
|
|
Petr Pisar: Changelog removed.
|
|
See <http://lists.pcre.org/lurker/message/20111121.203922.3cfd476e.en.html>.
|
|
|
|
|
|
Index: testdata/testoutput11
|
|
===================================================================
|
|
--- testdata/testoutput11 (revision 761)
|
|
+++ testdata/testoutput11 (revision 762)
|
|
@@ -1441,4 +1441,10 @@
|
|
xabcd
|
|
0: c
|
|
|
|
+/(a)(?2){2}(.)/
|
|
+ abcd
|
|
+ 0: abcd
|
|
+ 1: a
|
|
+ 2: d
|
|
+
|
|
/-- End of testinput11 --/
|
|
Index: testdata/testinput11
|
|
===================================================================
|
|
--- testdata/testinput11 (revision 761)
|
|
+++ testdata/testinput11 (revision 762)
|
|
@@ -800,4 +800,7 @@
|
|
/(?<=a(*THEN)b)c/
|
|
xabcd
|
|
|
|
+/(a)(?2){2}(.)/
|
|
+ abcd
|
|
+
|
|
/-- End of testinput11 --/
|
|
Index: pcre_compile.c
|
|
===================================================================
|
|
--- pcre_compile.c (revision 761)
|
|
+++ pcre_compile.c (revision 762)
|
|
@@ -4884,7 +4884,8 @@
|
|
*lengthptr += delta;
|
|
}
|
|
|
|
- /* This is compiling for real */
|
|
+ /* This is compiling for real. If there is a set first byte for
|
|
+ the group, and we have not yet set a "required byte", set it. */
|
|
|
|
else
|
|
{
|
|
@@ -6015,11 +6016,14 @@
|
|
}
|
|
}
|
|
|
|
- /* Insert the recursion/subroutine item. */
|
|
+ /* Insert the recursion/subroutine item. It does not have a set first
|
|
+ byte (relevant if it is repeated, because it will then be wrapped
|
|
+ with ONCE brackets). */
|
|
|
|
*code = OP_RECURSE;
|
|
PUT(code, 1, (int)(called - cd->start_code));
|
|
code += 1 + LINK_SIZE;
|
|
+ groupsetfirstbyte = FALSE;
|
|
}
|
|
|
|
/* Can't determine a first byte now */
|