From: Bram Moolenaar Date: Thu, 21 Nov 2013 15:03:40 +0000 (+0100) Subject: updated for version 7.4.100 X-Git-Tag: v7.4.100 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=272fb5823627e2e088b8f39ea516fc8a9341572e;p=vim 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 0c6ff0b63..cf7694bb0 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 2df9a6b60..77949c514 100644 --- a/src/testdir/test64.in +++ b/src/testdir/test64.in @@ -406,6 +406,7 @@ STARTTEST :call add(tl, [2, '^.*\.\(.*\)/.\+\(\1\)\@