]> granicus.if.org Git - vim/commitdiff
updated for version 7.4.020 v7.4.020
authorBram Moolenaar <Bram@vim.org>
Thu, 5 Sep 2013 14:05:36 +0000 (16:05 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 5 Sep 2013 14:05:36 +0000 (16:05 +0200)
Problem:    NFA engine matches too much with \@>. (John McGowan)
Solution:   When a whole pattern match is found stop searching.

src/regexp_nfa.c
src/testdir/test64.in
src/testdir/test64.ok
src/version.c

index 5288eb6d3f9a87fe51ac47b93e8a0ae53c998d73..fe1d0258292118e86ecb2fe3a3598124a1abe4d4 100644 (file)
@@ -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:
index ac3f13d54379483bb4e4d84f71516a51e2fa37d7..8f7008c1a16bb0240e7a709816606aa1355b48f0 100644 (file)
@@ -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'])
 :"
index da19c042376ee0ce9cd55c2c174bbf3468e549fd..fa83f91afa45b230a256a6d4fa92ce2d1af70736 100644 (file)
@@ -983,6 +983,9 @@ OK 2 - \(a*\)\@>a
 OK 0 - \(a*\)\@>b
 OK 1 - \(a*\)\@>b
 OK 2 - \(a*\)\@>b
+OK 0 - ^\(.\{-}b\)\@>.
+OK 1 - ^\(.\{-}b\)\@>.
+OK 2 - ^\(.\{-}b\)\@>.
 OK 0 - \(a*\)\@>a\|a\+
 OK 2 - \(a*\)\@>a\|a\+
 OK 0 - \_[^8-9]\+
index 0e6dc1c8072a9d0dc9478ed2fb77642a7f42a7a5..99c9d222df3563a6a6cc1d5383d0e197b9e3ac7f 100644 (file)
@@ -738,6 +738,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    20,
 /**/
     19,
 /**/