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