To: vim_dev@googlegroups.com Subject: Patch 7.4.289 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.4.289 Problem: Pattern with repeated backreference does not match with new regexp engine. (Urtica Dioica) Solution: Also check the end of a submatch when deciding to put a state in the state list. Files: src/testdir/test64.in, src/testdir/test64.ok, src/regexp_nfa.c *** ../vim-7.4.288/src/testdir/test64.in 2013-11-21 17:12:55.000000000 +0100 --- src/testdir/test64.in 2014-05-13 15:35:02.477659266 +0200 *************** *** 407,412 **** --- 407,413 ---- :call add(tl, [2, '^.*\.\(.*\)/.\+\(\1\)\@<=$', 'foo.bat/foo.bat', 'foo.bat/foo.bat', 'bat', 'bat']) :call add(tl, [2, '\\\@list.multi[i].start.col != sub2->list.multi[i].start.col) return FALSE; + + if (nfa_has_backref) + { + if (i < sub1->in_use) + s1 = sub1->list.multi[i].end.lnum; + else + s1 = -1; + if (i < sub2->in_use) + s2 = sub2->list.multi[i].end.lnum; + else + s2 = -1; + if (s1 != s2) + return FALSE; + if (s1 != -1 && sub1->list.multi[i].end.col + != sub2->list.multi[i].end.col) + return FALSE; + } } } else *************** *** 3992,3997 **** --- 4010,4028 ---- sp2 = NULL; if (sp1 != sp2) return FALSE; + if (nfa_has_backref) + { + if (i < sub1->in_use) + sp1 = sub1->list.line[i].end; + else + sp1 = NULL; + if (i < sub2->in_use) + sp2 = sub2->list.line[i].end; + else + sp2 = NULL; + if (sp1 != sp2) + return FALSE; + } } } *** ../vim-7.4.288/src/version.c 2014-05-13 14:03:36.425611242 +0200 --- src/version.c 2014-05-13 15:51:52.009668103 +0200 *************** *** 736,737 **** --- 736,739 ---- { /* Add new patch number below this line */ + /**/ + 289, /**/ -- hundred-and-one symptoms of being an internet addict: 152. You find yourself falling for someone you've never seen or hardly know, but, boy can he/she TYPE!!!!!! /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///