comparison src/fileio.c @ 6623:a532340f3940 v7.4.637

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)
author Bram Moolenaar <bram@vim.org>
date Tue, 17 Feb 2015 16:04:57 +0100
parents a871b5070d59
children 050e6df85f99
comparison
equal deleted inserted replaced
6622:3c312e259c79 6623:a532340f3940
8525 * detect special <buflocal[=X]> buffer-local patterns 8525 * detect special <buflocal[=X]> buffer-local patterns
8526 */ 8526 */
8527 is_buflocal = FALSE; 8527 is_buflocal = FALSE;
8528 buflocal_nr = 0; 8528 buflocal_nr = 0;
8529 8529
8530 if (patlen >= 7 && STRNCMP(pat, "<buffer", 7) == 0 8530 if (patlen >= 8 && STRNCMP(pat, "<buffer", 7) == 0
8531 && pat[patlen - 1] == '>') 8531 && pat[patlen - 1] == '>')
8532 { 8532 {
8533 /* Error will be printed only for addition. printing and removing 8533 /* "<buffer...>": Error will be printed only for addition.
8534 * will proceed silently. */ 8534 * printing and removing will proceed silently. */
8535 is_buflocal = TRUE; 8535 is_buflocal = TRUE;
8536 if (patlen == 8) 8536 if (patlen == 8)
8537 /* "<buffer>" */
8537 buflocal_nr = curbuf->b_fnum; 8538 buflocal_nr = curbuf->b_fnum;
8538 else if (patlen > 9 && pat[7] == '=') 8539 else if (patlen > 9 && pat[7] == '=')
8539 { 8540 {
8540 /* <buffer=abuf> */ 8541 if (patlen == 13 && STRNICMP(pat, "<buffer=abuf>", 13) == 0)
8541 if (patlen == 13 && STRNICMP(pat, "<buffer=abuf>", 13)) 8542 /* "<buffer=abuf>" */
8542 buflocal_nr = autocmd_bufnr; 8543 buflocal_nr = autocmd_bufnr;
8543 /* <buffer=123> */
8544 else if (skipdigits(pat + 8) == pat + patlen - 1) 8544 else if (skipdigits(pat + 8) == pat + patlen - 1)
8545 /* "<buffer=123>" */
8545 buflocal_nr = atoi((char *)pat + 8); 8546 buflocal_nr = atoi((char *)pat + 8);
8546 } 8547 }
8547 } 8548 }
8548 8549
8549 if (is_buflocal) 8550 if (is_buflocal)