111 lines
3.0 KiB
Plaintext
111 lines
3.0 KiB
Plaintext
To: vim_dev@googlegroups.com
|
||
Subject: Patch 7.3.796
|
||
Fcc: outbox
|
||
From: Bram Moolenaar <Bram@moolenaar.net>
|
||
Mime-Version: 1.0
|
||
Content-Type: text/plain; charset=UTF-8
|
||
Content-Transfer-Encoding: 8bit
|
||
------------
|
||
|
||
Patch 7.3.796
|
||
Problem: "/[^\n]" does match at a line break.
|
||
Solution: Make it do the same as "/.". (Christian Brabandt)
|
||
Files: src/regexp.c, src/testdir/test79.in, src/testdir/test79.ok
|
||
|
||
|
||
*** ../vim-7.3.795/src/regexp.c 2013-01-30 13:59:31.000000000 +0100
|
||
--- src/regexp.c 2013-01-30 18:16:12.000000000 +0100
|
||
***************
|
||
*** 2397,2409 ****
|
||
/* '\n' in range: also match NL */
|
||
if (ret != JUST_CALC_SIZE)
|
||
{
|
||
! if (*ret == ANYBUT)
|
||
! *ret = ANYBUT + ADD_NL;
|
||
! else if (*ret == ANYOF)
|
||
*ret = ANYOF + ADD_NL;
|
||
/* else: must have had a \n already */
|
||
}
|
||
- *flagp |= HASNL;
|
||
regparse++;
|
||
startc = -1;
|
||
}
|
||
--- 2397,2411 ----
|
||
/* '\n' in range: also match NL */
|
||
if (ret != JUST_CALC_SIZE)
|
||
{
|
||
! /* Using \n inside [^] does not change what
|
||
! * matches. "[^\n]" is the same as ".". */
|
||
! if (*ret == ANYOF)
|
||
! {
|
||
*ret = ANYOF + ADD_NL;
|
||
+ *flagp |= HASNL;
|
||
+ }
|
||
/* else: must have had a \n already */
|
||
}
|
||
regparse++;
|
||
startc = -1;
|
||
}
|
||
***************
|
||
*** 4344,4349 ****
|
||
--- 4346,4352 ----
|
||
break; /* Matched with EOW */
|
||
|
||
case ANY:
|
||
+ /* ANY does not match new lines. */
|
||
if (c == NUL)
|
||
status = RA_NOMATCH;
|
||
else
|
||
*** ../vim-7.3.795/src/testdir/test79.in 2011-06-19 04:31:54.000000000 +0200
|
||
--- src/testdir/test79.in 2013-01-30 17:56:11.000000000 +0100
|
||
***************
|
||
*** 201,211 ****
|
||
--- 201,215 ----
|
||
/^TEST/
|
||
j:s/A./\=submatch(0)/
|
||
j:s/B./\=submatch(0)/
|
||
+ /^Q$
|
||
+ :s/Q[^\n]Q/\=submatch(0)."foobar"/
|
||
ENDTEST
|
||
|
||
TEST_7:
|
||
A
|
||
A
|
||
B |