updated for version 7.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.
diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c
index 0c6ff0b..cf7694b 100644
--- a/src/regexp_nfa.c
+++ b/src/regexp_nfa.c
@@ -4278,7 +4278,7 @@
* 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 2df9a6b..77949c5 100644
--- a/src/testdir/test64.in
+++ b/src/testdir/test64.in
@@ -406,6 +406,7 @@
: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 401da40..4bbc533 100644
--- a/src/testdir/test64.ok
+++ b/src/testdir/test64.ok
@@ -944,6 +944,9 @@
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 7f9ae8b..ab3711d 100644
--- a/src/version.c
+++ b/src/version.c
@@ -739,6 +739,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 100,
+/**/
99,
/**/
98,