From 272fb5823627e2e088b8f39ea516fc8a9341572e Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 21 Nov 2013 16:03:40 +0100 Subject: [PATCH] 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. --- src/regexp_nfa.c | 2 +- src/testdir/test64.in | 1 + src/testdir/test64.ok | 3 +++ src/version.c | 2 ++ 4 files changed, 7 insertions(+), 1 deletion(-) 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\)\@