Revision: 611
http://vcs.pcre.org/viewvc?view=rev&revision=611
Author: ph10
Date: 2011-06-29 09:49:21 +0100 (Wed, 29 Jun 2011)
Log Message:
-----------
Fix \R problem with study: incorrect minimum subject length.
Modified Paths:
--------------
code/trunk/ChangeLog
code/trunk/pcre_study.c
Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog 2011-06-28 15:58:34 UTC (rev 610)
+++ code/trunk/ChangeLog 2011-06-29 08:49:21 UTC (rev 611)
@@ -97,6 +97,10 @@
the possibility of (*THEN) occurring in these branches, tail recursion is
no longer possible because the return has to be checked for (*THEN). These
two optimizations have therefore been removed.
+
+18. If a pattern containing \R was studied, it was assumed that \R always
+ matched two bytes, thus causing the minimum subject length to be
+ incorrectly computed because \R can also match just one byte.
Version 8.12 15-Jan-2011
Modified: code/trunk/pcre_study.c
===================================================================
--- code/trunk/pcre_study.c 2011-06-28 15:58:34 UTC (rev 610)
+++ code/trunk/pcre_study.c 2011-06-29 08:49:21 UTC (rev 611)
@@ -267,10 +267,11 @@
cc++;
break;
- /* "Any newline" might match two characters */
+ /* "Any newline" might match two characters, but it also might match just
+ one. */
case OP_ANYNL:
- branchlength += 2;
+ branchlength += 1;
cc++;
break;