dcaee6
To: vim_dev@googlegroups.com
dcaee6
Subject: Patch 7.4.100
dcaee6
Fcc: outbox
dcaee6
From: Bram Moolenaar <Bram@moolenaar.net>
dcaee6
Mime-Version: 1.0
dcaee6
Content-Type: text/plain; charset=UTF-8
dcaee6
Content-Transfer-Encoding: 8bit
dcaee6
------------
dcaee6
dcaee6
Patch 7.4.100
dcaee6
Problem:    NFA regexp doesn't handle backreference correctly. (Ryuichi
dcaee6
	    Hayashida, Urtica Dioica)
dcaee6
Solution:   Always add NFA_SKIP, also when it already exists at the start
dcaee6
	    position.
dcaee6
Files:      src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok
dcaee6
dcaee6
dcaee6
*** ../vim-7.4.099/src/regexp_nfa.c	2013-10-06 15:46:06.000000000 +0200
dcaee6
--- src/regexp_nfa.c	2013-11-21 15:58:58.000000000 +0100
dcaee6
***************
dcaee6
*** 4278,4284 ****
dcaee6
  	     * endless loop for "\(\)*" */
dcaee6
  
dcaee6
  	default:
dcaee6
! 	    if (state->lastlist[nfa_ll_index] == l->id)
dcaee6
  	    {
dcaee6
  		/* This state is already in the list, don't add it again,
dcaee6
  		 * unless it is an MOPEN that is used for a backreference or
dcaee6
--- 4278,4284 ----
dcaee6
  	     * endless loop for "\(\)*" */
dcaee6
  
dcaee6
  	default:
dcaee6
! 	    if (state->lastlist[nfa_ll_index] == l->id && state->c != NFA_SKIP)
dcaee6
  	    {
dcaee6
  		/* This state is already in the list, don't add it again,
dcaee6
  		 * unless it is an MOPEN that is used for a backreference or
dcaee6
*** ../vim-7.4.099/src/testdir/test64.in	2013-09-25 18:16:34.000000000 +0200
dcaee6
--- src/testdir/test64.in	2013-11-21 15:58:19.000000000 +0100
dcaee6
***************
dcaee6
*** 406,411 ****
dcaee6
--- 406,412 ----
dcaee6
  :call add(tl, [2, '^.*\.\(.*\)/.\+\(\1\)\@
dcaee6
  :call add(tl, [2, '^.*\.\(.*\)/.\+\(\1\)\@<=$', 'foo.bat/foo.bat', 'foo.bat/foo.bat', 'bat', 'bat'])
dcaee6
  :call add(tl, [2, '\\\@
dcaee6
+ :call add(tl, [2, '^\(a*\)\1$', 'aaaaaaaa', 'aaaaaaaa', 'aaaa'])
dcaee6
  :"
dcaee6
  :"""" Look-behind with limit
dcaee6
  :call add(tl, [2, '<\@<=span.', 'xxspanxx
dcaee6
*** ../vim-7.4.099/src/testdir/test64.ok	2013-09-25 18:16:34.000000000 +0200
dcaee6
--- src/testdir/test64.ok	2013-11-21 15:59:04.000000000 +0100
dcaee6
***************
dcaee6
*** 944,949 ****
dcaee6
--- 944,952 ----
dcaee6
  OK 0 - \\\@
dcaee6
  OK 1 - \\\@
dcaee6
  OK 2 - \\\@
dcaee6
+ OK 0 - ^\(a*\)\1$
dcaee6
+ OK 1 - ^\(a*\)\1$
dcaee6
+ OK 2 - ^\(a*\)\1$
dcaee6
  OK 0 - <\@<=span.
dcaee6
  OK 1 - <\@<=span.
dcaee6
  OK 2 - <\@<=span.
dcaee6
*** ../vim-7.4.099/src/version.c	2013-11-21 14:39:58.000000000 +0100
dcaee6
--- src/version.c	2013-11-21 16:02:27.000000000 +0100
dcaee6
***************
dcaee6
*** 740,741 ****
dcaee6
--- 740,743 ----
dcaee6
  {   /* Add new patch number below this line */
dcaee6
+ /**/
dcaee6
+     100,
dcaee6
  /**/
dcaee6
dcaee6
-- 
dcaee6
Sometimes you can protect millions of dollars in your budget simply by buying
dcaee6
a bag of cookies, dropping it on the budget anylyst's desk, and saying
dcaee6
something deeply personal such as "How was your weekend, big guy?"
dcaee6
				(Scott Adams - The Dilbert principle)
dcaee6
dcaee6
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
dcaee6
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
dcaee6
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
dcaee6
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///