Blame SOURCES/7.4.020

22c937
To: vim_dev@googlegroups.com
22c937
Subject: Patch 7.4.020
22c937
Fcc: outbox
22c937
From: Bram Moolenaar <Bram@moolenaar.net>
22c937
Mime-Version: 1.0
22c937
Content-Type: text/plain; charset=UTF-8
22c937
Content-Transfer-Encoding: 8bit
22c937
------------
22c937
22c937
Patch 7.4.020
22c937
Problem:    NFA engine matches too much with \@>. (John McGowan)
22c937
Solution:   When a whole pattern match is found stop searching.
22c937
Files:	    src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok
22c937
22c937
22c937
*** ../vim-7.4.019/src/regexp_nfa.c	2013-08-25 17:01:36.000000000 +0200
22c937
--- src/regexp_nfa.c	2013-09-05 15:59:44.000000000 +0200
22c937
***************
22c937
*** 5322,5328 ****
22c937
  		log_subsexpr(m);
22c937
  #endif
22c937
  		nfa_match = TRUE;
22c937
! 		break;
22c937
  
22c937
  	    case NFA_START_INVISIBLE:
22c937
  	    case NFA_START_INVISIBLE_FIRST:
22c937
--- 5322,5331 ----
22c937
  		log_subsexpr(m);
22c937
  #endif
22c937
  		nfa_match = TRUE;
22c937
! 		/* See comment above at "goto nextchar". */
22c937
! 		if (nextlist->n == 0)
22c937
! 		    clen = 0;
22c937
! 		goto nextchar;
22c937
  
22c937
  	    case NFA_START_INVISIBLE:
22c937
  	    case NFA_START_INVISIBLE_FIRST:
22c937
*** ../vim-7.4.019/src/testdir/test64.in	2013-08-14 13:31:03.000000000 +0200
22c937
--- src/testdir/test64.in	2013-09-05 15:35:44.000000000 +0200
22c937
***************
22c937
*** 427,432 ****
22c937
--- 427,433 ----
22c937
  :""""" \@>
22c937
  :call add(tl, [2, '\(a*\)\@>a', 'aaaa'])
22c937
  :call add(tl, [2, '\(a*\)\@>b', 'aaab', 'aaab', 'aaa'])
22c937
+ :call add(tl, [2, '^\(.\{-}b\)\@>.', '  abcbd', '  abc', '  ab'])
22c937
  :" TODO: BT engine does not restore submatch after failure
22c937
  :call add(tl, [1, '\(a*\)\@>a\|a\+', 'aaaa', 'aaaa'])
22c937
  :"
22c937
*** ../vim-7.4.019/src/testdir/test64.ok	2013-08-14 13:31:03.000000000 +0200
22c937
--- src/testdir/test64.ok	2013-09-05 16:03:34.000000000 +0200
22c937
***************
22c937
*** 983,988 ****
22c937
--- 983,991 ----
22c937
  OK 0 - \(a*\)\@>b
22c937
  OK 1 - \(a*\)\@>b
22c937
  OK 2 - \(a*\)\@>b
22c937
+ OK 0 - ^\(.\{-}b\)\@>.
22c937
+ OK 1 - ^\(.\{-}b\)\@>.
22c937
+ OK 2 - ^\(.\{-}b\)\@>.
22c937
  OK 0 - \(a*\)\@>a\|a\+
22c937
  OK 2 - \(a*\)\@>a\|a\+
22c937
  OK 0 - \_[^8-9]\+
22c937
*** ../vim-7.4.019/src/version.c	2013-09-05 13:50:49.000000000 +0200
22c937
--- src/version.c	2013-09-05 16:04:32.000000000 +0200
22c937
***************
22c937
*** 740,741 ****
22c937
--- 740,743 ----
22c937
  {   /* Add new patch number below this line */
22c937
+ /**/
22c937
+     20,
22c937
  /**/
22c937
22c937
-- 
22c937
hundred-and-one symptoms of being an internet addict:
22c937
173. You keep tracking down the email addresses of all your friends
22c937
     (even childhood friends).
22c937
22c937
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
22c937
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
22c937
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
22c937
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///