]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.796 v7.3.796
authorBram Moolenaar <Bram@vim.org>
Wed, 30 Jan 2013 17:21:51 +0000 (18:21 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 30 Jan 2013 17:21:51 +0000 (18:21 +0100)
Problem:    "/[^\n]" does match at a line break.
Solution:   Make it do the same as "/.". (Christian Brabandt)

src/regexp.c
src/testdir/test79.in
src/testdir/test79.ok
src/version.c

index b6506a03a613f738502b1805ea3a159aabc9d2eb..d85ded8af07177da9bdd89466e1b759cfa41efab 100644 (file)
@@ -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
index 8fa11d9ad79cd389169051166babb22d8e1f4041..f83b6b6e2265fe6f2581e015e3e0e94c01ed3fa6 100644 (file)
Binary files a/src/testdir/test79.in and b/src/testdir/test79.in differ
index 6685b44f9ad2366519b66ddc20078429269f7e43..31ad3a41e46912727705358d815ae596c8a19a7a 100644 (file)
Binary files a/src/testdir/test79.ok and b/src/testdir/test79.ok differ
index e729a617fe190d8d13d8cc0185cec64687ac743c..f289e437e10a893ec0250f8b6c15dbb01d64243c 100644 (file)
@@ -725,6 +725,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    796,
 /**/
     795,
 /**/