Mercurial > vim
changeset 5334:c1ae5baa41f4 v7.4.020
updated for version 7.4.020
Problem: NFA engine matches too much with \@>. (John McGowan)
Solution: When a whole pattern match is found stop searching.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Thu, 05 Sep 2013 16:05:36 +0200 |
parents | 20062f4cb25d |
children | f4b96a5d4a22 |
files | src/regexp_nfa.c src/testdir/test64.in src/testdir/test64.ok src/version.c |
diffstat | 4 files changed, 10 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/regexp_nfa.c +++ b/src/regexp_nfa.c @@ -5322,7 +5322,10 @@ nfa_regmatch(prog, start, submatch, m) log_subsexpr(m); #endif nfa_match = TRUE; - break; + /* See comment above at "goto nextchar". */ + if (nextlist->n == 0) + clen = 0; + goto nextchar; case NFA_START_INVISIBLE: case NFA_START_INVISIBLE_FIRST:
--- a/src/testdir/test64.in +++ b/src/testdir/test64.in @@ -427,6 +427,7 @@ STARTTEST :""""" \@> :call add(tl, [2, '\(a*\)\@>a', 'aaaa']) :call add(tl, [2, '\(a*\)\@>b', 'aaab', 'aaab', 'aaa']) +:call add(tl, [2, '^\(.\{-}b\)\@>.', ' abcbd', ' abc', ' ab']) :" TODO: BT engine does not restore submatch after failure :call add(tl, [1, '\(a*\)\@>a\|a\+', 'aaaa', 'aaaa']) :"