Blame SOURCES/pcre-8.32-Fix-group-empty-match-bug.patch

08805a
From 17a94e8c64fac96d8c95403f80b7ed61e8c8ff77 Mon Sep 17 00:00:00 2001
08805a
From: ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>
08805a
Date: Tue, 9 Jun 2015 17:45:25 +0000
08805a
Subject: [PATCH] Fix group empty match bug.
08805a
MIME-Version: 1.0
08805a
Content-Type: text/plain; charset=UTF-8
08805a
Content-Transfer-Encoding: 8bit
08805a
08805a
Ported to 8.32:
08805a
08805a
commit 382ca2bb4ffd423aceab05c4b1c1885cd3a48958
08805a
Author: ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>
08805a
Date:   Tue Jun 9 17:45:25 2015 +0000
08805a
08805a
    Fix group empty match bug.
08805a
08805a
    git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1566 2f5784b3-3f2a-0410-8824-cb99058d5e15
08805a
08805a
Signed-off-by: Petr Písař <ppisar@redhat.com>
08805a
---
08805a
 pcre_compile.c       |  2 +-
08805a
 testdata/testinput2  |  2 ++
08805a
 testdata/testoutput2 | 18 ++++++++++++++++++
08805a
 3 files changed, 21 insertions(+), 1 deletion(-)
08805a
08805a
diff --git a/pcre_compile.c b/pcre_compile.c
08805a
index 7d203eb..d570447 100644
08805a
--- a/pcre_compile.c
08805a
+++ b/pcre_compile.c
08805a
@@ -2477,7 +2477,7 @@ for (code = first_significant_code(code + PRIV(OP_lengths)[*code], TRUE);
08805a
   if (c == OP_BRA  || c == OP_BRAPOS ||
08805a
       c == OP_CBRA || c == OP_CBRAPOS ||
08805a
       c == OP_ONCE || c == OP_ONCE_NC ||
08805a
-      c == OP_COND)
08805a
+      c == OP_COND || c == OP_SCOND)
08805a
     {
08805a
     BOOL empty_branch;
08805a
     if (GET(code, 1) == 0) return TRUE;    /* Hit unclosed bracket */
08805a
diff --git a/testdata/testinput2 b/testdata/testinput2
08805a
index 1b83cf2..fc6fe2f 100644
08805a
--- a/testdata/testinput2
08805a
+++ b/testdata/testinput2
08805a
@@ -3825,4 +3825,6 @@ settings of the anchored and startline bits. --/
08805a
 ".*?\h.+.\.+\R*?\xd(?i)(?=!(?=b`b`b`\`b\xa9b!)`\a`bbbbbbbbbbbbb`bbbbbbbbbbbb*R\x85bbbbbbb\C?{((?2)(?))((
08805a
 \H){8(?<=(?1){29}\xa8bbbb\x16\xd\xc6^($(?
08805a
 
08805a
+/^(?:(?(1)x|)+)+$()/BZ
08805a
+
08805a
 /-- End of testinput2 --/
08805a
diff --git a/testdata/testoutput2 b/testdata/testoutput2
08805a
index e33b4e2..63b39c2 100644
08805a
--- a/testdata/testoutput2
08805a
+++ b/testdata/testoutput2
08805a
@@ -12522,4 +12522,22 @@ No match
08805a
 ".*?\h.+.\.+\R*?\xd(?i)(?=!(?=b`b`b`\`b\xa9b!)`\a`bbbbbbbbbbbbb`bbbbbbbbbbbb*R\x85bbbbbbb\C?{((?2)(?))((
08805a
 \H){8(?<=(?1){29}\xa8bbbb\x16\xd\xc6^($(?
08805a
 
08805a
+/^(?:(?(1)x|)+)+$()/BZ
08805a
+------------------------------------------------------------------
08805a
+        Bra
08805a
+        ^
08805a
+        SBra
08805a
+        SCond
08805a
+      1 Cond ref
08805a
+        x
08805a
+        Alt
08805a
+        KetRmax
08805a
+        KetRmax
08805a
+        $
08805a
+        CBra 1
08805a
+        Ket
08805a
+        Ket
08805a
+        End
08805a
+------------------------------------------------------------------
08805a
+
08805a
 /-- End of testinput2 --/
08805a
-- 
08805a
2.5.5
08805a