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

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