summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2009-03-08 15:26:59 +0000
committerph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2009-03-08 15:26:59 +0000
commit37569cffc46bc5a250ee35aaa08619c715686c1f (patch)
treed2bc71d125f42a4d85914e39dfedbad0599e216d
parentfe1f5e1559a9ea99c2dab4e5295a003b7cad9440 (diff)
downloadpcre-37569cffc46bc5a250ee35aaa08619c715686c1f.tar.gz
Fix PCRE_DOLLAR_ENDONLY bug in pcre_dfa_exec().
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@383 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r--ChangeLog3
-rw-r--r--pcre_dfa_exec.c7
-rw-r--r--testdata/testinput79
-rw-r--r--testdata/testoutput714
4 files changed, 30 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 91a3e0b..5340811 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -44,6 +44,9 @@ Version 7.9 xx-xxx-09
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
diff --git a/pcre_dfa_exec.c b/pcre_dfa_exec.c
index 61bf0ce..da0af62 100644
--- a/pcre_dfa_exec.c
+++ b/pcre_dfa_exec.c
@@ -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 @@ for (;;)
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); }
diff --git a/testdata/testinput7 b/testdata/testinput7
index 5ec4827..dbe9c1a 100644
--- a/testdata/testinput7
+++ b/testdata/testinput7
@@ -4392,4 +4392,13 @@
** Failers
ab
+/X$/E
+ X
+ ** Failers
+ X\n
+
+/X$/
+ X
+ X\n
+
/ End of testinput7 /
diff --git a/testdata/testoutput7 b/testdata/testoutput7
index aef4b6c..2756a67 100644
--- a/testdata/testoutput7
+++ b/testdata/testoutput7
@@ -7254,4 +7254,18 @@ No match
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 /