|
|
22c937 |
To: vim_dev@googlegroups.com
|
|
|
22c937 |
Subject: Patch 7.4.101
|
|
|
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.101
|
|
|
22c937 |
Problem: Using \1 in pattern goes one line too far. (Bohr Shaw, John Little)
|
|
|
22c937 |
Solution: Only advance the match end for the matched characters in the last
|
|
|
22c937 |
line.
|
|
|
22c937 |
Files: src/regexp.c, src/testdir/test64.in, src/testdir/test64.ok
|
|
|
22c937 |
|
|
|
22c937 |
|
|
|
22c937 |
*** ../vim-7.4.100/src/regexp.c 2013-09-19 17:03:57.000000000 +0200
|
|
|
22c937 |
--- src/regexp.c 2013-11-21 16:58:38.000000000 +0100
|
|
|
22c937 |
***************
|
|
|
22c937 |
*** 6455,6461 ****
|
|
|
22c937 |
/*
|
|
|
22c937 |
* Check whether a backreference matches.
|
|
|
22c937 |
* Returns RA_FAIL, RA_NOMATCH or RA_MATCH.
|
|
|
22c937 |
! * If "bytelen" is not NULL, it is set to the bytelength of the whole match.
|
|
|
22c937 |
*/
|
|
|
22c937 |
static int
|
|
|
22c937 |
match_with_backref(start_lnum, start_col, end_lnum, end_col, bytelen)
|
|
|
22c937 |
--- 6455,6462 ----
|
|
|
22c937 |
/*
|
|
|
22c937 |
* Check whether a backreference matches.
|
|
|
22c937 |
* Returns RA_FAIL, RA_NOMATCH or RA_MATCH.
|
|
|
22c937 |
! * If "bytelen" is not NULL, it is set to the byte length of the match in the
|
|
|
22c937 |
! * last line.
|
|
|
22c937 |
*/
|
|
|
22c937 |
static int
|
|
|
22c937 |
match_with_backref(start_lnum, start_col, end_lnum, end_col, bytelen)
|
|
|
22c937 |
***************
|
|
|
22c937 |
*** 6511,6516 ****
|
|
|
22c937 |
--- 6512,6519 ----
|
|
|
22c937 |
|
|
|
22c937 |
/* Advance to next line. */
|
|
|
22c937 |
reg_nextline();
|
|
|
22c937 |
+ if (bytelen != NULL)
|
|
|
22c937 |
+ *bytelen = 0;
|
|
|
22c937 |
++clnum;
|
|
|
22c937 |
ccol = 0;
|
|
|
22c937 |
if (got_int)
|
|
|
22c937 |
*** ../vim-7.4.100/src/testdir/test64.in 2013-11-21 16:03:35.000000000 +0100
|
|
|
22c937 |
--- src/testdir/test64.in 2013-11-21 16:56:20.000000000 +0100
|
|
|
22c937 |
***************
|
|
|
22c937 |
*** 507,512 ****
|
|
|
22c937 |
--- 507,514 ----
|
|
|
22c937 |
:" Check a pattern with a line break and ^ and $
|
|
|
22c937 |
:call add(tl, [2, 'a\n^b$\n^c', ['a', 'b', 'c'], ['XX']])
|
|
|
22c937 |
:"
|
|
|
22c937 |
+ :call add(tl, [2, '\(^.\+\n\)\1', [' dog', ' dog', 'asdf'], ['XXasdf']])
|
|
|
22c937 |
+ :"
|
|
|
22c937 |
:"""" Run the multi-line tests
|
|
|
22c937 |
:"
|
|
|
22c937 |
:$put ='multi-line tests'
|
|
|
22c937 |
*** ../vim-7.4.100/src/testdir/test64.ok 2013-11-21 16:03:35.000000000 +0100
|
|
|
22c937 |
--- src/testdir/test64.ok 2013-11-21 16:57:41.000000000 +0100
|
|
|
22c937 |
***************
|
|
|
22c937 |
*** 1031,1036 ****
|
|
|
22c937 |
--- 1031,1039 ----
|
|
|
22c937 |
OK 0 - a\n^b$\n^c
|
|
|
22c937 |
OK 1 - a\n^b$\n^c
|
|
|
22c937 |
OK 2 - a\n^b$\n^c
|
|
|
22c937 |
+ OK 0 - \(^.\+\n\)\1
|
|
|
22c937 |
+ OK 1 - \(^.\+\n\)\1
|
|
|
22c937 |
+ OK 2 - \(^.\+\n\)\1
|
|
|
22c937 |
|
|
|
22c937 |
<T="5">Ta 5</Title>
|
|
|
22c937 |
<T="7">Ac 7</Title>
|
|
|
22c937 |
*** ../vim-7.4.100/src/version.c 2013-11-21 16:03:35.000000000 +0100
|
|
|
22c937 |
--- src/version.c 2013-11-21 16:44:00.000000000 +0100
|
|
|
22c937 |
***************
|
|
|
22c937 |
*** 740,741 ****
|
|
|
22c937 |
--- 740,743 ----
|
|
|
22c937 |
{ /* Add new patch number below this line */
|
|
|
22c937 |
+ /**/
|
|
|
22c937 |
+ 101,
|
|
|
22c937 |
/**/
|
|
|
22c937 |
|
|
|
22c937 |
--
|
|
|
22c937 |
The budget process was invented by an alien race of sadistic beings who
|
|
|
22c937 |
resemble large cats.
|
|
|
22c937 |
(Scott Adams - The Dilbert principle)
|
|
|
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 ///
|