Blame SOURCES/pcre-8.42-Fix-bad-auto-possessify-for-certain-classes.patch

22122f
From 952cac5f4a17e52aec7d0536f405b25428367840 Mon Sep 17 00:00:00 2001
22122f
From: ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>
22122f
Date: Fri, 17 Aug 2018 14:50:21 +0000
22122f
Subject: [PATCH] Fix bad auto-possessify for certain classes.
22122f
MIME-Version: 1.0
22122f
Content-Type: text/plain; charset=UTF-8
22122f
Content-Transfer-Encoding: 8bit
22122f
22122f
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1738 2f5784b3-3f2a-0410-8824-cb99058d5e15
22122f
Petr Písař: Ported to 8.42.
22122f
---
22122f
 pcre_compile.c       | 4 ++--
22122f
 testdata/testinput4  | 3 +++
22122f
 testdata/testoutput4 | 4 ++++
22122f
22122f
diff --git a/pcre_compile.c b/pcre_compile.c
22122f
index 6dd8886..3991d6c 100644
22122f
--- a/pcre_compile.c
22122f
+++ b/pcre_compile.c
22122f
@@ -6,7 +6,7 @@
22122f
 and semantics are as close as possible to those of the Perl 5 language.
22122f
 
22122f
                        Written by Philip Hazel
22122f
-           Copyright (c) 1997-2016 University of Cambridge
22122f
+           Copyright (c) 1997-2018 University of Cambridge
22122f
 
22122f
 -----------------------------------------------------------------------------
22122f
 Redistribution and use in source and binary forms, with or without
22122f
@@ -3299,7 +3299,7 @@ for(;;)
22122f
       if ((*xclass_flags & XCL_MAP) == 0)
22122f
         {
22122f
         /* No bits are set for characters < 256. */
22122f
-        if (list[1] == 0) return TRUE;
22122f
+        if (list[1] == 0) return (*xclass_flags & XCL_NOT) == 0;
22122f
         /* Might be an empty repeat. */
22122f
         continue;
22122f
         }
22122f
diff --git a/testdata/testinput4 b/testdata/testinput4
22122f
index 8bdbdac..63368c0 100644
22122f
--- a/testdata/testinput4
22122f
+++ b/testdata/testinput4
22122f
@@ -727,4 +727,7 @@
22122f
 /\C(\W?ſ)'?{{/8
22122f
     \\C(\\W?ſ)'?{{
22122f
 
22122f
+/[^\x{100}-\x{ffff}]*[\x80-\xff]/8
22122f
+    \x{99}\x{99}\x{99}
22122f
+
22122f
 /-- End of testinput4 --/
22122f
diff --git a/testdata/testoutput4 b/testdata/testoutput4
22122f
index d43c123..69e812c 100644
22122f
--- a/testdata/testoutput4
22122f
+++ b/testdata/testoutput4
22122f
@@ -1277,4 +1277,8 @@ No match
22122f
     \\C(\\W?ſ)'?{{
22122f
 No match
22122f
 
22122f
+/[^\x{100}-\x{ffff}]*[\x80-\xff]/8
22122f
+    \x{99}\x{99}\x{99}
22122f
+ 0: \x{99}\x{99}\x{99}
22122f
+
22122f
 /-- End of testinput4 --/
22122f
-- 
22122f
2.14.4
22122f