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