[Pcre-svn] [983] code/trunk: Fix 2 incorrect #ifdefs in pcre…

Top Page
Delete this message
Author: Subversion repository
Date:  
To: pcre-svn
Subject: [Pcre-svn] [983] code/trunk: Fix 2 incorrect #ifdefs in pcre_study.c.
Revision: 983
          http://vcs.pcre.org/viewvc?view=rev&revision=983
Author:   ph10
Date:     2012-07-06 09:55:10 +0100 (Fri, 06 Jul 2012)


Log Message:
-----------
Fix 2 incorrect #ifdefs in pcre_study.c.

Modified Paths:
--------------
    code/trunk/ChangeLog
    code/trunk/pcre_study.c
    code/trunk/testdata/testinput18
    code/trunk/testdata/testoutput18


Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog    2012-06-20 15:15:27 UTC (rev 982)
+++ code/trunk/ChangeLog    2012-07-06 08:55:10 UTC (rev 983)
@@ -1,7 +1,7 @@
 ChangeLog for PCRE
 ------------------


-Version 8.31 20-June-2012
+Version 8.31 06-July-2012
-------------------------

 1.  Fixing a wrong JIT test case and some compiler warnings.
@@ -150,7 +150,10 @@
     and pcregrep, because some OS require shared objects to be explicitly
     passed to ld, causing the link step to fail if they are not.


+41. There were two incorrect #ifdefs in pcre_study.c, meaning that, in 16-bit
+    mode, patterns that started with \h* or \R* might be incorrectly matched.


+
Version 8.30 04-February-2012
-----------------------------


Modified: code/trunk/pcre_study.c
===================================================================
--- code/trunk/pcre_study.c    2012-06-20 15:15:27 UTC (rev 982)
+++ code/trunk/pcre_study.c    2012-07-06 08:55:10 UTC (rev 983)
@@ -1123,7 +1123,7 @@
         case OP_HSPACE:
         SET_BIT(0x09);
         SET_BIT(0x20);
-#ifdef COMPILE_PCRE8
+#ifdef SUPPORT_UTF
         if (utf)
           {
 #ifdef COMPILE_PCRE8
@@ -1148,7 +1148,7 @@
         SET_BIT(0x0B);
         SET_BIT(0x0C);
         SET_BIT(0x0D);
-#ifdef COMPILE_PCRE8
+#ifdef SUPPORT_UTF
         if (utf)
           {
 #ifdef COMPILE_PCRE8


Modified: code/trunk/testdata/testinput18
===================================================================
--- code/trunk/testdata/testinput18    2012-06-20 15:15:27 UTC (rev 982)
+++ code/trunk/testdata/testinput18    2012-07-06 08:55:10 UTC (rev 983)
@@ -194,7 +194,12 @@


 /\h*A/SI8
     CDBABC
+    \x{2000}ABC 


+/\R*A/SI8
+    CDBABC
+    \x{2028}A  
+
 /\v+A/SI8


/\s?xxx\s/8SI

Modified: code/trunk/testdata/testoutput18
===================================================================
--- code/trunk/testdata/testoutput18    2012-06-20 15:15:27 UTC (rev 982)
+++ code/trunk/testdata/testoutput18    2012-07-06 08:55:10 UTC (rev 983)
@@ -692,10 +692,24 @@
 No first char
 Need char = 'A'
 Subject length lower bound = 1
-Starting byte set: \x09 \x20 A \xa0 
+Starting byte set: \x09 \x20 A \xa0 \xff 
     CDBABC
  0: A
+    \x{2000}ABC 
+ 0: \x{2000}A


+/\R*A/SI8
+Capturing subpattern count = 0
+Options: utf
+No first char
+Need char = 'A'
+Subject length lower bound = 1
+Starting byte set: \x0a \x0b \x0c \x0d A \x85 \xff 
+    CDBABC
+ 0: A
+    \x{2028}A  
+ 0: \x{2028}A
+
 /\v+A/SI8
 Capturing subpattern count = 0
 Options: utf