Revision: 1485
http://vcs.pcre.org/viewvc?view=rev&revision=1485
Author: ph10
Date: 2014-06-18 17:31:32 +0100 (Wed, 18 Jun 2014)
Log Message:
-----------
Fix bad starting data when char with more than one other case follows
circumflex in multiline UTF mode.
Modified Paths:
--------------
code/trunk/ChangeLog
code/trunk/pcre_compile.c
code/trunk/testdata/testinput6
code/trunk/testdata/testinput7
code/trunk/testdata/testoutput6
code/trunk/testdata/testoutput7
Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog 2014-06-17 16:00:15 UTC (rev 1484)
+++ code/trunk/ChangeLog 2014-06-18 16:31:32 UTC (rev 1485)
@@ -60,6 +60,10 @@
the reference to 'Name' was incorrectly treated as a reference to a
duplicate name.
+
+12. A pattern such as /^s?c/mi8 where the optional character has more than
+ one "other case" was incorrectly compiled such that it would only try to
+ match starting at "c".
Version 8.35 04-April-2014
Modified: code/trunk/pcre_compile.c
===================================================================
--- code/trunk/pcre_compile.c 2014-06-17 16:00:15 UTC (rev 1484)
+++ code/trunk/pcre_compile.c 2014-06-18 16:31:32 UTC (rev 1485)
@@ -4694,7 +4694,8 @@
previous = NULL;
if ((options & PCRE_MULTILINE) != 0)
{
- if (firstcharflags == REQ_UNSET) firstcharflags = REQ_NONE;
+ if (firstcharflags == REQ_UNSET)
+ zerofirstcharflags = firstcharflags = REQ_NONE;
*code++ = OP_CIRCM;
}
else *code++ = OP_CIRC;
Modified: code/trunk/testdata/testinput6
===================================================================
--- code/trunk/testdata/testinput6 2014-06-17 16:00:15 UTC (rev 1484)
+++ code/trunk/testdata/testinput6 2014-06-18 16:31:32 UTC (rev 1485)
@@ -1493,4 +1493,7 @@
/[q-u]+/8iW
Ss\x{17f}
+/^s?c/mi8
+ scat
+
/-- End of testinput6 --/
Modified: code/trunk/testdata/testinput7
===================================================================
--- code/trunk/testdata/testinput7 2014-06-17 16:00:15 UTC (rev 1484)
+++ code/trunk/testdata/testinput7 2014-06-18 16:31:32 UTC (rev 1485)
@@ -835,4 +835,7 @@
/[Q-U]+/8iWBZ
+/^s?c/mi8I
+ scat
+
/-- End of testinput7 --/
Modified: code/trunk/testdata/testoutput6
===================================================================
--- code/trunk/testdata/testoutput6 2014-06-17 16:00:15 UTC (rev 1484)
+++ code/trunk/testdata/testoutput6 2014-06-18 16:31:32 UTC (rev 1485)
@@ -2457,4 +2457,8 @@
Ss\x{17f}
0: Ss\x{17f}
+/^s?c/mi8
+ scat
+ 0: sc
+
/-- End of testinput6 --/
Modified: code/trunk/testdata/testoutput7
===================================================================
--- code/trunk/testdata/testoutput7 2014-06-17 16:00:15 UTC (rev 1484)
+++ code/trunk/testdata/testoutput7 2014-06-18 16:31:32 UTC (rev 1485)
@@ -2287,4 +2287,12 @@
End
------------------------------------------------------------------
+/^s?c/mi8I
+Capturing subpattern count = 0
+Options: caseless multiline utf
+First char at start or follows newline
+Need char = 'c' (caseless)
+ scat
+ 0: sc
+
/-- End of testinput7 --/