summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-11-21 16:03:40 +0100
committerBram Moolenaar <Bram@vim.org>2013-11-21 16:03:40 +0100
commit272fb5823627e2e088b8f39ea516fc8a9341572e (patch)
tree15071eae29d3505e7be7abaf33689bbec774c941
parentcafaa8a9502f64d5c23e51c1f89c5b322deb22fe (diff)
updated for version 7.4.100v7.4.100
Problem: NFA regexp doesn't handle backreference correctly. (Ryuichi Hayashida, Urtica Dioica) Solution: Always add NFA_SKIP, also when it already exists at the start position.
-rw-r--r--src/regexp_nfa.c2
-rw-r--r--src/testdir/test64.in1
-rw-r--r--src/testdir/test64.ok3
-rw-r--r--src/version.c2
4 files changed, 7 insertions, 1 deletions
diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c
index 0c6ff0b633..cf7694bb0b 100644
--- a/src/regexp_nfa.c
+++ b/src/regexp_nfa.c
@@ -4278,7 +4278,7 @@ addstate(l, state, subs_arg, pim, off)
* endless loop for "\(\)*" */
default:
- if (state->lastlist[nfa_ll_index] == l->id)
+ if (state->lastlist[nfa_ll_index] == l->id && state->c != NFA_SKIP)
{
/* This state is already in the list, don't add it again,
* unless it is an MOPEN that is used for a backreference or
diff --git a/src/testdir/test64.in b/src/testdir/test64.in
index 2df9a6b60e..77949c5141 100644
--- a/src/testdir/test64.in
+++ b/src/testdir/test64.in
@@ -406,6 +406,7 @@ STARTTEST
:call add(tl, [2, '^.*\.\(.*\)/.\+\(\1\)\@<!$', 'foo.bat/foo.bat'])
:call add(tl, [2, '^.*\.\(.*\)/.\+\(\1\)\@<=$', 'foo.bat/foo.bat', 'foo.bat/foo.bat', 'bat', 'bat'])
:call add(tl, [2, '\\\@<!\${\(\d\+\%(:.\{-}\)\?\\\@<!\)}', '2013-06-27${0}', '${0}', '0'])
+:call add(tl, [2, '^\(a*\)\1$', 'aaaaaaaa', 'aaaaaaaa', 'aaaa'])
:"
:"""" Look-behind with limit
:call add(tl, [2, '<\@<=span.', 'xxspanxx<spanyyy', 'spany'])
diff --git a/src/testdir/test64.ok b/src/testdir/test64.ok
index 401da4071d..4bbc5335dc 100644
--- a/src/testdir/test64.ok
+++ b/src/testdir/test64.ok
@@ -944,6 +944,9 @@ OK 2 - ^.*\.\(.*\)/.\+\(\1\)\@<=$
OK 0 - \\\@<!\${\(\d\+\%(:.\{-}\)\?\\\@<!\)}
OK 1 - \\\@<!\${\(\d\+\%(:.\{-}\)\?\\\@<!\)}
OK 2 - \\\@<!\${\(\d\+\%(:.\{-}\)\?\\\@<!\)}
+OK 0 - ^\(a*\)\1$
+OK 1 - ^\(a*\)\1$
+OK 2 - ^\(a*\)\1$
OK 0 - <\@<=span.
OK 1 - <\@<=span.
OK 2 - <\@<=span.
diff --git a/src/version.c b/src/version.c
index 7f9ae8b7eb..ab3711d102 100644
--- a/src/version.c
+++ b/src/version.c
@@ -739,6 +739,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 100,
+/**/
99,
/**/
98,