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\)\@