Skip to content

Commit 068be4c

Browse files
committed
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)
1 parent 819b9ca commit 068be4c

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

src/fileio.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8527,21 +8527,22 @@ do_autocmd_event(event, pat, nested, cmd, forceit, group)
85278527
is_buflocal = FALSE;
85288528
buflocal_nr = 0;
85298529

8530-
if (patlen >= 7 && STRNCMP(pat, "<buffer", 7) == 0
8530+
if (patlen >= 8 && STRNCMP(pat, "<buffer", 7) == 0
85318531
&& pat[patlen - 1] == '>')
85328532
{
8533-
/* Error will be printed only for addition. printing and removing
8534-
* will proceed silently. */
8533+
/* "<buffer...>": Error will be printed only for addition.
8534+
* printing and removing will proceed silently. */
85358535
is_buflocal = TRUE;
85368536
if (patlen == 8)
8537+
/* "<buffer>" */
85378538
buflocal_nr = curbuf->b_fnum;
85388539
else if (patlen > 9 && pat[7] == '=')
85398540
{
8540-
/* <buffer=abuf> */
8541-
if (patlen == 13 && STRNICMP(pat, "<buffer=abuf>", 13))
8541+
if (patlen == 13 && STRNICMP(pat, "<buffer=abuf>", 13) == 0)
8542+
/* "<buffer=abuf>" */
85428543
buflocal_nr = autocmd_bufnr;
8543-
/* <buffer=123> */
85448544
else if (skipdigits(pat + 8) == pat + patlen - 1)
8545+
/* "<buffer=123>" */
85458546
buflocal_nr = atoi((char *)pat + 8);
85468547
}
85478548
}

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,8 @@ static char *(features[]) =
741741

742742
static int included_patches[] =
743743
{ /* Add new patch number below this line */
744+
/**/
745+
637,
744746
/**/
745747
636,
746748
/**/

0 commit comments

Comments
 (0)