[Pcre-svn] [1487] code/trunk: Fix bad compile of [\Qx]...

トップ ページ
このメッセージを削除
著者: Subversion repository
日付:  
To: pcre-svn
題目: [Pcre-svn] [1487] code/trunk: Fix bad compile of [\Qx]...
Revision: 1487
          http://vcs.pcre.org/viewvc?view=rev&revision=1487
Author:   ph10
Date:     2014-06-18 18:17:03 +0100 (Wed, 18 Jun 2014)


Log Message:
-----------
Fix bad compile of [\Qx]... where x is any character.

Modified Paths:
--------------
    code/trunk/ChangeLog
    code/trunk/pcre_compile.c
    code/trunk/testdata/testinput1
    code/trunk/testdata/testoutput1


Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog    2014-06-18 16:48:57 UTC (rev 1486)
+++ code/trunk/ChangeLog    2014-06-18 17:17:03 UTC (rev 1487)
@@ -68,6 +68,9 @@
 13. When a pattern starting with \s was studied, VT was not included in the 
     list of possible starting characters; this should have been part of the 
     8.34/18 patch.
+    
+14. If a character class started [\Qx]... where x is any character, the class
+    was incorrectly terminated at the ].



Version 8.35 04-April-2014

Modified: code/trunk/pcre_compile.c
===================================================================
--- code/trunk/pcre_compile.c    2014-06-18 16:48:57 UTC (rev 1486)
+++ code/trunk/pcre_compile.c    2014-06-18 17:17:03 UTC (rev 1487)
@@ -5325,7 +5325,7 @@
       whatever repeat count may follow. In the case of reqchar, save the
       previous value for reinstating. */


-      if (class_one_char == 1 && ptr[1] == CHAR_RIGHT_SQUARE_BRACKET)
+      if (!inescq && class_one_char == 1 && ptr[1] == CHAR_RIGHT_SQUARE_BRACKET)
         {
         ptr++;
         zeroreqchar = reqchar;


Modified: code/trunk/testdata/testinput1
===================================================================
--- code/trunk/testdata/testinput1    2014-06-18 16:48:57 UTC (rev 1486)
+++ code/trunk/testdata/testinput1    2014-06-18 17:17:03 UTC (rev 1487)
@@ -5708,4 +5708,10 @@
 /\sabc/
     \x{0b}abc


+/[\Qa]\E]+/
+    aa]]
+
+/[\Q]a\E]+/
+    aa]]
+
 /-- End of testinput1 --/


Modified: code/trunk/testdata/testoutput1
===================================================================
--- code/trunk/testdata/testoutput1    2014-06-18 16:48:57 UTC (rev 1486)
+++ code/trunk/testdata/testoutput1    2014-06-18 17:17:03 UTC (rev 1487)
@@ -9393,4 +9393,12 @@
     \x{0b}abc
  0: \x0babc


+/[\Qa]\E]+/
+    aa]]
+ 0: aa]]
+
+/[\Q]a\E]+/
+    aa]]
+ 0: aa]]
+
 /-- End of testinput1 --/