Revision: 1601
http://vcs.pcre.org/viewvc?view=rev&revision=1601
Author: ph10
Date: 2015-10-09 17:11:18 +0100 (Fri, 09 Oct 2015)
Log Message:
-----------
Fix compile bug for classes like [\W\p{Any}].
Modified Paths:
--------------
code/trunk/ChangeLog
code/trunk/pcre_compile.c
code/trunk/testdata/testinput5
code/trunk/testdata/testoutput5
Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog 2015-09-02 08:54:57 UTC (rev 1600)
+++ code/trunk/ChangeLog 2015-10-09 16:11:18 UTC (rev 1601)
@@ -155,6 +155,10 @@
41. Remove the use of /dev/null in testdata/testinput2, because it doesn't
work under Windows. (Why has it taken so long for anyone to notice?)
+
+42. In a character class such as [\W\p{Any}] where both a negative-type escape
+ ("not a word character") and a property escape were present, the property
+ escape was being ignored.
Version 8.37 28-April-2015
Modified: code/trunk/pcre_compile.c
===================================================================
--- code/trunk/pcre_compile.c 2015-09-02 08:54:57 UTC (rev 1600)
+++ code/trunk/pcre_compile.c 2015-10-09 16:11:18 UTC (rev 1601)
@@ -5512,9 +5512,10 @@
actual compiled code. */
#ifdef SUPPORT_UTF
- if (xclass && (!should_flip_negation || (options & PCRE_UCP) != 0))
+ if (xclass && (xclass_has_prop || !should_flip_negation ||
+ (options & PCRE_UCP) != 0))
#elif !defined COMPILE_PCRE8
- if (xclass && !should_flip_negation)
+ if (xclass && (xclass_has_prop || !should_flip_negation))
#endif
#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
{
Modified: code/trunk/testdata/testinput5
===================================================================
--- code/trunk/testdata/testinput5 2015-09-02 08:54:57 UTC (rev 1600)
+++ code/trunk/testdata/testinput5 2015-10-09 16:11:18 UTC (rev 1601)
@@ -800,4 +800,13 @@
/(?<=\K\x{17f})/8G+
\x{17f}\x{17f}\x{17f}\x{17f}\x{17f}
+/[\W\p{Any}]/BZ
+ abc
+ 123
+
+/[\W\pL]/BZ
+ abc
+ ** Failers
+ 123
+
/-- End of testinput5 --/
Modified: code/trunk/testdata/testoutput5
===================================================================
--- code/trunk/testdata/testoutput5 2015-09-02 08:54:57 UTC (rev 1600)
+++ code/trunk/testdata/testoutput5 2015-10-09 16:11:18 UTC (rev 1601)
@@ -1944,4 +1944,30 @@
0: \x{17f}
0+
+/[\W\p{Any}]/BZ
+------------------------------------------------------------------
+ Bra
+ [\x00-/:-@[-^`{-\xff\p{Any}]
+ Ket
+ End
+------------------------------------------------------------------
+ abc
+ 0: a
+ 123
+ 0: 1
+
+/[\W\pL]/BZ
+------------------------------------------------------------------
+ Bra
+ [\x00-/:-@[-^`{-\xff\p{L}]
+ Ket
+ End
+------------------------------------------------------------------
+ abc
+ 0: a
+ ** Failers
+ 0: *
+ 123
+No match
+
/-- End of testinput5 --/