Blob Blame History Raw
From 8d8c3dbadff3d0735ba696acf211c14b3025622f Mon Sep 17 00:00:00 2001
From: ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>
Date: Wed, 18 Jun 2014 17:17:03 +0000
Subject: [PATCH] Fix bad compile of [\Qx]...  where x is any character.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1487 2f5784b3-3f2a-0410-8824-cb99058d5e15
Signed-off-by: Petr Písař <ppisar@redhat.com>

Petr Pisar: Ported to 8.35.

diff --git a/pcre_compile.c b/pcre_compile.c
index 29d3c29..c44839e 100644
--- a/pcre_compile.c
+++ b/pcre_compile.c
@@ -5325,7 +5325,7 @@ for (;; ptr++)
       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;
diff --git a/testdata/testinput1 b/testdata/testinput1
index c9ebf9f..5513d16 100644
--- a/testdata/testinput1
+++ b/testdata/testinput1
@@ -5708,4 +5708,10 @@ AbcdCBefgBhiBqz
 /\sabc/
     \x{0b}abc
 
+/[\Qa]\E]+/
+    aa]]
+
+/[\Q]a\E]+/
+    aa]]
+
 /-- End of testinput1 --/
diff --git a/testdata/testoutput1 b/testdata/testoutput1
index 6eb7d2d..cfa90d6 100644
--- a/testdata/testoutput1
+++ b/testdata/testoutput1
@@ -9393,4 +9393,12 @@ No match
     \x{0b}abc
  0: \x0babc
 
+/[\Qa]\E]+/
+    aa]]
+ 0: aa]]
+
+/[\Q]a\E]+/
+    aa]]
+ 0: aa]]
+
 /-- End of testinput1 --/
-- 
1.9.3