summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2015-10-09 16:11:18 +0000
committerph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2015-10-09 16:11:18 +0000
commit7b67e393f64afd69c48e585d3e4291d7d1b3a0f5 (patch)
tree9ee2a385457109b2ee9973bfa4e39935a9096e84
parent22b0d506f8a1894a38c745a7b32b235cd660a4b3 (diff)
downloadpcre-7b67e393f64afd69c48e585d3e4291d7d1b3a0f5.tar.gz
Fix compile bug for classes like [\W\p{Any}].
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1601 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r--ChangeLog4
-rw-r--r--pcre_compile.c5
-rw-r--r--testdata/testinput59
-rw-r--r--testdata/testoutput526
4 files changed, 42 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 5893c78..adf428a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -155,6 +155,10 @@ Version 8.38 xx-xxx-xxxx
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
diff --git a/pcre_compile.c b/pcre_compile.c
index 191330a..f8ce576 100644
--- a/pcre_compile.c
+++ b/pcre_compile.c
@@ -5512,9 +5512,10 @@ for (;; ptr++)
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
{
diff --git a/testdata/testinput5 b/testdata/testinput5
index 28561a9..c825ca2 100644
--- a/testdata/testinput5
+++ b/testdata/testinput5
@@ -798,4 +798,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 --/
diff --git a/testdata/testoutput5 b/testdata/testoutput5
index bab989c..42e5e16 100644
--- a/testdata/testoutput5
+++ b/testdata/testoutput5
@@ -1942,4 +1942,30 @@ Need char = 'z'
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 --/