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