0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

updated for version 7.4.637

Problem:    Incorrectly read the number of buffer for which an autocommand
            should be registered.
Solution:   Reverse check for "<buffer=abuf>". (Lech Lorens)
This commit is contained in:
Bram Moolenaar
2015-02-17 16:04:57 +01:00
parent 35e7594dd4
commit 1e997827f1
2 changed files with 9 additions and 6 deletions

View File

@@ -8527,21 +8527,22 @@ do_autocmd_event(event, pat, nested, cmd, forceit, group)
is_buflocal = FALSE; is_buflocal = FALSE;
buflocal_nr = 0; buflocal_nr = 0;
if (patlen >= 7 && STRNCMP(pat, "<buffer", 7) == 0 if (patlen >= 8 && STRNCMP(pat, "<buffer", 7) == 0
&& pat[patlen - 1] == '>') && pat[patlen - 1] == '>')
{ {
/* Error will be printed only for addition. printing and removing /* "<buffer...>": Error will be printed only for addition.
* will proceed silently. */ * printing and removing will proceed silently. */
is_buflocal = TRUE; is_buflocal = TRUE;
if (patlen == 8) if (patlen == 8)
/* "<buffer>" */
buflocal_nr = curbuf->b_fnum; buflocal_nr = curbuf->b_fnum;
else if (patlen > 9 && pat[7] == '=') else if (patlen > 9 && pat[7] == '=')
{ {
/* <buffer=abuf> */ if (patlen == 13 && STRNICMP(pat, "<buffer=abuf>", 13) == 0)
if (patlen == 13 && STRNICMP(pat, "<buffer=abuf>", 13)) /* "<buffer=abuf>" */
buflocal_nr = autocmd_bufnr; buflocal_nr = autocmd_bufnr;
/* <buffer=123> */
else if (skipdigits(pat + 8) == pat + patlen - 1) else if (skipdigits(pat + 8) == pat + patlen - 1)
/* "<buffer=123>" */
buflocal_nr = atoi((char *)pat + 8); buflocal_nr = atoi((char *)pat + 8);
} }
} }

View File

@@ -741,6 +741,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
637,
/**/ /**/
636, 636,
/**/ /**/