]> granicus.if.org Git - vim/commitdiff
updated for version 7.4.100 v7.4.100
authorBram Moolenaar <Bram@vim.org>
Thu, 21 Nov 2013 15:03:40 +0000 (16:03 +0100)
committerBram Moolenaar <Bram@vim.org>
Thu, 21 Nov 2013 15:03:40 +0000 (16:03 +0100)
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
src/testdir/test64.in
src/testdir/test64.ok
src/version.c

index 0c6ff0b6332cec718fc1fbe7936635b56861eaf9..cf7694bb0b27223de028be071f8486945e7e5348 100644 (file)
@@ -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
index 2df9a6b60e2424d47fdfefdce2bf8694a6766233..77949c5141086a1778f80deb22da692c46ca78ec 100644 (file)
@@ -406,6 +406,7 @@ STARTTEST
 :call add(tl, [2, '^.*\.\(.*\)/.\+\(\1\)\@<!$', 'foo.bat/foo.bat'])
 :call add(tl, [2, '^.*\.\(.*\)/.\+\(\1\)\@<=$', 'foo.bat/foo.bat', 'foo.bat/foo.bat', 'bat', 'bat'])
 :call add(tl, [2, '\\\@<!\${\(\d\+\%(:.\{-}\)\?\\\@<!\)}', '2013-06-27${0}', '${0}', '0'])
+:call add(tl, [2, '^\(a*\)\1$', 'aaaaaaaa', 'aaaaaaaa', 'aaaa'])
 :"
 :"""" Look-behind with limit
 :call add(tl, [2, '<\@<=span.', 'xxspanxx<spanyyy', 'spany'])
index 401da4071dbb82655a67793376e98a945d68b615..4bbc5335dc8b4f906d6f6b10b740668857c42701 100644 (file)
@@ -944,6 +944,9 @@ OK 2 - ^.*\.\(.*\)/.\+\(\1\)\@<=$
 OK 0 - \\\@<!\${\(\d\+\%(:.\{-}\)\?\\\@<!\)}
 OK 1 - \\\@<!\${\(\d\+\%(:.\{-}\)\?\\\@<!\)}
 OK 2 - \\\@<!\${\(\d\+\%(:.\{-}\)\?\\\@<!\)}
+OK 0 - ^\(a*\)\1$
+OK 1 - ^\(a*\)\1$
+OK 2 - ^\(a*\)\1$
 OK 0 - <\@<=span.
 OK 1 - <\@<=span.
 OK 2 - <\@<=span.
index 7f9ae8b7ebf963f1d1061786d36165a15fd4f331..ab3711d102cf16452ae631856dfb1ca88c6df727 100644 (file)
@@ -738,6 +738,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    100,
 /**/
     99,
 /**/