# HG changeset patch # User Bram Moolenaar # Date 1385046220 -3600 # Node ID 5ad60cd88339c6217fbea8cf4f92dae04ac1c71d # Parent 397bf7d448d192e8ca8403b42b8ca1542a518790 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 --- 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 --- a/src/testdir/test64.in +++ b/src/testdir/test64.in @@ -406,6 +406,7 @@ STARTTEST :call add(tl, [2, '^.*\.\(.*\)/.\+\(\1\)\@