From: Bram Moolenaar Date: Wed, 30 Jan 2013 17:21:51 +0000 (+0100) Subject: updated for version 7.3.796 X-Git-Tag: v7.3.796 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e337e5f634dcb0e74999d67286125a85423e38a9;p=vim updated for version 7.3.796 Problem: "/[^\n]" does match at a line break. Solution: Make it do the same as "/.". (Christian Brabandt) --- diff --git a/src/regexp.c b/src/regexp.c index b6506a03a..d85ded8af 100644 --- a/src/regexp.c +++ b/src/regexp.c @@ -2397,13 +2397,15 @@ collection: /* '\n' in range: also match NL */ if (ret != JUST_CALC_SIZE) { - if (*ret == ANYBUT) - *ret = ANYBUT + ADD_NL; - else if (*ret == ANYOF) + /* 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 */ } - *flagp |= HASNL; regparse++; startc = -1; } @@ -4344,6 +4346,7 @@ regmatch(scan) break; /* Matched with EOW */ case ANY: + /* ANY does not match new lines. */ if (c == NUL) status = RA_NOMATCH; else diff --git a/src/testdir/test79.in b/src/testdir/test79.in index 8fa11d9ad..f83b6b6e2 100644 Binary files a/src/testdir/test79.in and b/src/testdir/test79.in differ diff --git a/src/testdir/test79.ok b/src/testdir/test79.ok index 6685b44f9..31ad3a41e 100644 Binary files a/src/testdir/test79.ok and b/src/testdir/test79.ok differ diff --git a/src/version.c b/src/version.c index e729a617f..f289e437e 100644 --- a/src/version.c +++ b/src/version.c @@ -725,6 +725,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 796, /**/ 795, /**/