]> granicus.if.org Git - vim/commitdiff
updated for version 7.4.637 v7.4.637
authorBram Moolenaar <Bram@vim.org>
Tue, 17 Feb 2015 15:04:57 +0000 (16:04 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 17 Feb 2015 15:04:57 +0000 (16:04 +0100)
Problem:    Incorrectly read the number of buffer for which an autocommand
            should be registered.
Solution:   Reverse check for "<buffer=abuf>". (Lech Lorens)

src/fileio.c
src/version.c

index 319c7ba9758b6c9548747ad501c7d5670de6461b..1d16ee8dd180106f5c042256bb45836d24991a71 100644 (file)
@@ -8527,21 +8527,22 @@ do_autocmd_event(event, pat, nested, cmd, forceit, group)
        is_buflocal = FALSE;
        buflocal_nr = 0;
 
-       if (patlen >= 7 && STRNCMP(pat, "<buffer", 7) == 0
+       if (patlen >= 8 && STRNCMP(pat, "<buffer", 7) == 0
                                                    && pat[patlen - 1] == '>')
        {
-           /* Error will be printed only for addition. printing and removing
-            * will proceed silently. */
+           /* "<buffer...>": Error will be printed only for addition.
+            * printing and removing will proceed silently. */
            is_buflocal = TRUE;
            if (patlen == 8)
+               /* "<buffer>" */
                buflocal_nr = curbuf->b_fnum;
            else if (patlen > 9 && pat[7] == '=')
            {
-               /* <buffer=abuf> */
-               if (patlen == 13 && STRNICMP(pat, "<buffer=abuf>", 13))
+               if (patlen == 13 && STRNICMP(pat, "<buffer=abuf>", 13) == 0)
+                   /* "<buffer=abuf>" */
                    buflocal_nr = autocmd_bufnr;
-               /* <buffer=123> */
                else if (skipdigits(pat + 8) == pat + patlen - 1)
+                   /* "<buffer=123>" */
                    buflocal_nr = atoi((char *)pat + 8);
            }
        }
index 226386ac5dac84a49c74dbc94139029d554b550d..207ac12b01057093d401e9c94fab39ced104f341 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    637,
 /**/
     636,
 /**/