Revision: 383
http://vcs.pcre.org/viewvc?view=rev&revision=383
Author: ph10
Date: 2009-03-08 15:26:59 +0000 (Sun, 08 Mar 2009)
Log Message:
-----------
Fix PCRE_DOLLAR_ENDONLY bug in pcre_dfa_exec().
Modified Paths:
--------------
code/trunk/ChangeLog
code/trunk/pcre_dfa_exec.c
code/trunk/testdata/testinput7
code/trunk/testdata/testoutput7
Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog 2009-03-08 15:11:02 UTC (rev 382)
+++ code/trunk/ChangeLog 2009-03-08 15:26:59 UTC (rev 383)
@@ -44,6 +44,9 @@
9. If auto-callout was enabled in a pattern with a conditional group, PCRE
could crash during matching.
+
+10. The PCRE_DOLLAR_ENDONLY option was not working when pcre_dfa_exec() was
+ used for matching.
Version 7.8 05-Sep-08
Modified: code/trunk/pcre_dfa_exec.c
===================================================================
--- code/trunk/pcre_dfa_exec.c 2009-03-08 15:11:02 UTC (rev 382)
+++ code/trunk/pcre_dfa_exec.c 2009-03-08 15:26:59 UTC (rev 383)
@@ -3,10 +3,11 @@
*************************************************/
/* PCRE is a library of functions to support regular expressions whose syntax
-and semantics are as close as possible to those of the Perl 5 language.
+and semantics are as close as possible to those of the Perl 5 language (but see
+below for why this module is different).
Written by Philip Hazel
- Copyright (c) 1997-2008 University of Cambridge
+ Copyright (c) 1997-2009 University of Cambridge
-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
@@ -757,7 +758,7 @@
if ((md->moptions & PCRE_NOTEOL) == 0)
{
if (clen == 0 ||
- (IS_NEWLINE(ptr) &&
+ ((md->poptions & PCRE_DOLLAR_ENDONLY) == 0 && IS_NEWLINE(ptr) &&
((ims & PCRE_MULTILINE) != 0 || ptr == end_subject - md->nllen)
))
{ ADD_ACTIVE(state_offset + 1, 0); }
Modified: code/trunk/testdata/testinput7
===================================================================
--- code/trunk/testdata/testinput7 2009-03-08 15:11:02 UTC (rev 382)
+++ code/trunk/testdata/testinput7 2009-03-08 15:26:59 UTC (rev 383)
@@ -4392,4 +4392,13 @@
** Failers
ab
+/X$/E
+ X
+ ** Failers
+ X\n
+
+/X$/
+ X
+ X\n
+
/ End of testinput7 /
Modified: code/trunk/testdata/testoutput7
===================================================================
--- code/trunk/testdata/testoutput7 2009-03-08 15:11:02 UTC (rev 382)
+++ code/trunk/testdata/testoutput7 2009-03-08 15:26:59 UTC (rev 383)
@@ -7254,4 +7254,18 @@
ab
No match
+/X$/E
+ X
+ 0: X
+ ** Failers
+No match
+ X\n
+No match
+
+/X$/
+ X
+ 0: X
+ X\n
+ 0: X
+
/ End of testinput7 /