7c3a573
From a65e1b693110caa27fe8f724583fc28ce5924026 Mon Sep 17 00:00:00 2001
7c3a573
From: ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>
7c3a573
Date: Sat, 20 Oct 2018 09:38:44 +0000
7c3a573
Subject: [PATCH] Fix zero-repeat leading subroutine call first character
7c3a573
 error.
7c3a573
MIME-Version: 1.0
7c3a573
Content-Type: text/plain; charset=UTF-8
7c3a573
Content-Transfer-Encoding: 8bit
7c3a573
7c3a573
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1741 2f5784b3-3f2a-0410-8824-cb99058d5e15
7c3a573
Petr Písař: Ported to 8.42.
7c3a573
---
7c3a573
 pcre_compile.c       |  2 ++
7c3a573
 testdata/testinput1  | 15 +++++++++++++++
7c3a573
 testdata/testoutput1 | 24 ++++++++++++++++++++++++
7c3a573
7c3a573
diff --git a/pcre_compile.c b/pcre_compile.c
7c3a573
index 6141fb3..079d30a 100644
7c3a573
--- a/pcre_compile.c
7c3a573
+++ b/pcre_compile.c
7c3a573
@@ -7642,6 +7642,8 @@ for (;; ptr++)
7c3a573
         /* Can't determine a first byte now */
7c3a573
 
7c3a573
         if (firstcharflags == REQ_UNSET) firstcharflags = REQ_NONE;
7c3a573
+        zerofirstchar = firstchar;
7c3a573
+        zerofirstcharflags = firstcharflags;
7c3a573
         continue;
7c3a573
 
7c3a573
 
7c3a573
diff --git a/testdata/testinput1 b/testdata/testinput1
7c3a573
index 5c23f41..02e4f48 100644
7c3a573
--- a/testdata/testinput1
7c3a573
+++ b/testdata/testinput1
7c3a573
@@ -5742,4 +5742,19 @@ AbcdCBefgBhiBqz
7c3a573
 /X+(?#comment)?/
7c3a573
     >XXX<
7c3a573
 
7c3a573
+/   (?<word> \w+ )*    \.   /xi
7c3a573
+    pokus.
7c3a573
+    
7c3a573
+/(?(DEFINE) (?<word> \w+ ) ) (?&word)*   \./xi
7c3a573
+    pokus.
7c3a573
+
7c3a573
+/(?(DEFINE) (?<word> \w+ ) ) ( (?&word)* )   \./xi 
7c3a573
+    pokus.
7c3a573
+
7c3a573
+/(?&word)*  (?(DEFINE) (?<word> \w+ ) )  \./xi
7c3a573
+    pokus.
7c3a573
+
7c3a573
+/(?&word)*  \. (?<word> \w+ )/xi
7c3a573
+    pokus.hokus
7c3a573
+
7c3a573
 /-- End of testinput1 --/
7c3a573
diff --git a/testdata/testoutput1 b/testdata/testoutput1
7c3a573
index eff8ecc..e6147e6 100644
7c3a573
--- a/testdata/testoutput1
7c3a573
+++ b/testdata/testoutput1
7c3a573
@@ -9446,4 +9446,28 @@ No match
7c3a573
     >XXX<
7c3a573
  0: X
7c3a573
 
7c3a573
+/   (?<word> \w+ )*    \.   /xi
7c3a573
+    pokus.
7c3a573
+ 0: pokus.
7c3a573
+ 1: pokus
7c3a573
+    
7c3a573
+/(?(DEFINE) (?<word> \w+ ) ) (?&word)*   \./xi
7c3a573
+    pokus.
7c3a573
+ 0: pokus.
7c3a573
+
7c3a573
+/(?(DEFINE) (?<word> \w+ ) ) ( (?&word)* )   \./xi 
7c3a573
+    pokus.
7c3a573
+ 0: pokus.
7c3a573
+ 1: <unset>
7c3a573
+ 2: pokus
7c3a573
+
7c3a573
+/(?&word)*  (?(DEFINE) (?<word> \w+ ) )  \./xi
7c3a573
+    pokus.
7c3a573
+ 0: pokus.
7c3a573
+
7c3a573
+/(?&word)*  \. (?<word> \w+ )/xi
7c3a573
+    pokus.hokus
7c3a573
+ 0: pokus.hokus
7c3a573
+ 1: hokus
7c3a573
+
7c3a573
 /-- End of testinput1 --/
7c3a573
-- 
7c3a573
2.17.2
7c3a573