lkundrak / rpms / vim

Forked from rpms/vim 4 years ago
Clone
0148740
To: vim_dev@googlegroups.com
0148740
Subject: Patch 7.4.101
0148740
Fcc: outbox
0148740
From: Bram Moolenaar <Bram@moolenaar.net>
0148740
Mime-Version: 1.0
0148740
Content-Type: text/plain; charset=UTF-8
0148740
Content-Transfer-Encoding: 8bit
0148740
------------
0148740
0148740
Patch 7.4.101
0148740
Problem:    Using \1 in pattern goes one line too far. (Bohr Shaw, John Little)
0148740
Solution:   Only advance the match end for the matched characters in the last
0148740
	    line.
0148740
Files:	    src/regexp.c, src/testdir/test64.in, src/testdir/test64.ok
0148740
0148740
0148740
*** ../vim-7.4.100/src/regexp.c	2013-09-19 17:03:57.000000000 +0200
0148740
--- src/regexp.c	2013-11-21 16:58:38.000000000 +0100
0148740
***************
0148740
*** 6455,6461 ****
0148740
  /*
0148740
   * Check whether a backreference matches.
0148740
   * Returns RA_FAIL, RA_NOMATCH or RA_MATCH.
0148740
!  * If "bytelen" is not NULL, it is set to the bytelength of the whole match.
0148740
   */
0148740
      static int
0148740
  match_with_backref(start_lnum, start_col, end_lnum, end_col, bytelen)
0148740
--- 6455,6462 ----
0148740
  /*
0148740
   * Check whether a backreference matches.
0148740
   * Returns RA_FAIL, RA_NOMATCH or RA_MATCH.
0148740
!  * If "bytelen" is not NULL, it is set to the byte length of the match in the
0148740
!  * last line.
0148740
   */
0148740
      static int
0148740
  match_with_backref(start_lnum, start_col, end_lnum, end_col, bytelen)
0148740
***************
0148740
*** 6511,6516 ****
0148740
--- 6512,6519 ----
0148740
  
0148740
  	/* Advance to next line. */
0148740
  	reg_nextline();
0148740
+ 	if (bytelen != NULL)
0148740
+ 	    *bytelen = 0;
0148740
  	++clnum;
0148740
  	ccol = 0;
0148740
  	if (got_int)
0148740
*** ../vim-7.4.100/src/testdir/test64.in	2013-11-21 16:03:35.000000000 +0100
0148740
--- src/testdir/test64.in	2013-11-21 16:56:20.000000000 +0100
0148740
***************
0148740
*** 507,512 ****
0148740
--- 507,514 ----
0148740
  :" Check a pattern with a line break and ^ and $
0148740
  :call add(tl, [2, 'a\n^b$\n^c', ['a', 'b', 'c'], ['XX']])
0148740
  :"
0148740
+ :call add(tl, [2, '\(^.\+\n\)\1', [' dog', ' dog', 'asdf'], ['XXasdf']])
0148740
+ :"
0148740
  :"""" Run the multi-line tests
0148740
  :"
0148740
  :$put ='multi-line tests'
0148740
*** ../vim-7.4.100/src/testdir/test64.ok	2013-11-21 16:03:35.000000000 +0100
0148740
--- src/testdir/test64.ok	2013-11-21 16:57:41.000000000 +0100
0148740
***************
0148740
*** 1031,1036 ****
0148740
--- 1031,1039 ----
0148740
  OK 0 - a\n^b$\n^c
0148740
  OK 1 - a\n^b$\n^c
0148740
  OK 2 - a\n^b$\n^c
0148740
+ OK 0 - \(^.\+\n\)\1
0148740
+ OK 1 - \(^.\+\n\)\1
0148740
+ OK 2 - \(^.\+\n\)\1
0148740
  
0148740
  <T="5">Ta 5</Title>
0148740
  <T="7">Ac 7</Title>
0148740
*** ../vim-7.4.100/src/version.c	2013-11-21 16:03:35.000000000 +0100
0148740
--- src/version.c	2013-11-21 16:44:00.000000000 +0100
0148740
***************
0148740
*** 740,741 ****
0148740
--- 740,743 ----
0148740
  {   /* Add new patch number below this line */
0148740
+ /**/
0148740
+     101,
0148740
  /**/
0148740
0148740
-- 
0148740
The budget process was invented by an alien race of sadistic beings who
0148740
resemble large cats.
0148740
				(Scott Adams - The Dilbert principle)
0148740
0148740
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
0148740
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
0148740
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
0148740
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///