Revision: 441
http://www.exim.org/viewvc/pcre2?view=rev&revision=441
Author: ph10
Date: 2015-11-17 17:59:35 +0000 (Tue, 17 Nov 2015)
Log Message:
-----------
Fix [:punct:] bug in UCP mode (matching chars in the range 128-255)
Modified Paths:
--------------
code/trunk/ChangeLog
code/trunk/src/pcre2_xclass.c
code/trunk/testdata/testinput4
code/trunk/testdata/testoutput4
Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog 2015-11-17 17:13:43 UTC (rev 440)
+++ code/trunk/ChangeLog 2015-11-17 17:59:35 UTC (rev 441)
@@ -318,7 +318,10 @@
by a single ASCII character in a class item, was incorrectly compiled in UCP
mode. The POSIX class got lost, but only if the single character followed it.
+96. [:punct:] in UCP mode was matching some characters in the range 128-255
+that should not have been matched.
+
Version 10.20 30-June-2015
--------------------------
Modified: code/trunk/src/pcre2_xclass.c
===================================================================
--- code/trunk/src/pcre2_xclass.c 2015-11-17 17:13:43 UTC (rev 440)
+++ code/trunk/src/pcre2_xclass.c 2015-11-17 17:59:35 UTC (rev 441)
@@ -247,7 +247,7 @@
case PT_PXPUNCT:
if ((PRIV(ucp_gentype)[prop->chartype] == ucp_P ||
- (c < 256 && PRIV(ucp_gentype)[prop->chartype] == ucp_S)) == isprop)
+ (c < 128 && PRIV(ucp_gentype)[prop->chartype] == ucp_S)) == isprop)
return !negated;
break;
Modified: code/trunk/testdata/testinput4
===================================================================
--- code/trunk/testdata/testinput4 2015-11-17 17:13:43 UTC (rev 440)
+++ code/trunk/testdata/testinput4 2015-11-17 17:59:35 UTC (rev 441)
@@ -2233,4 +2233,7 @@
/[^\p{Any}]*+x/utf
x
+/[[:punct:]]/utf,ucp
+ \x{b4}
+
# End of testinput4
Modified: code/trunk/testdata/testoutput4
===================================================================
--- code/trunk/testdata/testoutput4 2015-11-17 17:13:43 UTC (rev 440)
+++ code/trunk/testdata/testoutput4 2015-11-17 17:59:35 UTC (rev 441)
@@ -3620,4 +3620,8 @@
x
0: x
+/[[:punct:]]/utf,ucp
+ \x{b4}
+No match
+
# End of testinput4