Karsten Hopp db5d42
To: vim_dev@googlegroups.com
Karsten Hopp db5d42
Subject: Patch 7.4.637
Karsten Hopp db5d42
Fcc: outbox
Karsten Hopp db5d42
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp db5d42
Mime-Version: 1.0
Karsten Hopp db5d42
Content-Type: text/plain; charset=UTF-8
Karsten Hopp db5d42
Content-Transfer-Encoding: 8bit
Karsten Hopp db5d42
------------
Karsten Hopp db5d42
Karsten Hopp db5d42
Patch 7.4.637
Karsten Hopp db5d42
Problem:    Incorrectly read the number of buffer for which an autocommand
Karsten Hopp db5d42
            should be registered. 
Karsten Hopp db5d42
Solution:   Reverse check for "<buffer=abuf>". (Lech Lorens)
Karsten Hopp db5d42
Files:      src/fileio.c
Karsten Hopp db5d42
Karsten Hopp db5d42
Karsten Hopp db5d42
*** ../vim-7.4.636/src/fileio.c	2015-02-17 14:15:13.005523167 +0100
Karsten Hopp db5d42
--- src/fileio.c	2015-02-17 16:00:42.039330110 +0100
Karsten Hopp db5d42
***************
Karsten Hopp db5d42
*** 8527,8547 ****
Karsten Hopp db5d42
  	is_buflocal = FALSE;
Karsten Hopp db5d42
  	buflocal_nr = 0;
Karsten Hopp db5d42
  
Karsten Hopp db5d42
! 	if (patlen >= 7 && STRNCMP(pat, "
Karsten Hopp db5d42
  						    && pat[patlen - 1] == '>')
Karsten Hopp db5d42
  	{
Karsten Hopp db5d42
! 	    /* Error will be printed only for addition. printing and removing
Karsten Hopp db5d42
! 	     * will proceed silently. */
Karsten Hopp db5d42
  	    is_buflocal = TRUE;
Karsten Hopp db5d42
  	    if (patlen == 8)
Karsten Hopp db5d42
  		buflocal_nr = curbuf->b_fnum;
Karsten Hopp db5d42
  	    else if (patlen > 9 && pat[7] == '=')
Karsten Hopp db5d42
  	    {
Karsten Hopp db5d42
! 		/* <buffer=abuf> */
Karsten Hopp db5d42
! 		if (patlen == 13 && STRNICMP(pat, "<buffer=abuf>", 13))
Karsten Hopp db5d42
  		    buflocal_nr = autocmd_bufnr;
Karsten Hopp db5d42
- 		/* <buffer=123> */
Karsten Hopp db5d42
  		else if (skipdigits(pat + 8) == pat + patlen - 1)
Karsten Hopp db5d42
  		    buflocal_nr = atoi((char *)pat + 8);
Karsten Hopp db5d42
  	    }
Karsten Hopp db5d42
  	}
Karsten Hopp db5d42
--- 8527,8548 ----
Karsten Hopp db5d42
  	is_buflocal = FALSE;
Karsten Hopp db5d42
  	buflocal_nr = 0;
Karsten Hopp db5d42
  
Karsten Hopp db5d42
! 	if (patlen >= 8 && STRNCMP(pat, "
Karsten Hopp db5d42
  						    && pat[patlen - 1] == '>')
Karsten Hopp db5d42
  	{
Karsten Hopp db5d42
! 	    /* "<buffer...>": Error will be printed only for addition.
Karsten Hopp db5d42
! 	     * printing and removing will proceed silently. */
Karsten Hopp db5d42
  	    is_buflocal = TRUE;
Karsten Hopp db5d42
  	    if (patlen == 8)
Karsten Hopp db5d42
+ 		/* "<buffer>" */
Karsten Hopp db5d42
  		buflocal_nr = curbuf->b_fnum;
Karsten Hopp db5d42
  	    else if (patlen > 9 && pat[7] == '=')
Karsten Hopp db5d42
  	    {
Karsten Hopp db5d42
! 		if (patlen == 13 && STRNICMP(pat, "<buffer=abuf>", 13) == 0)
Karsten Hopp db5d42
! 		    /* "<buffer=abuf>" */
Karsten Hopp db5d42
  		    buflocal_nr = autocmd_bufnr;
Karsten Hopp db5d42
  		else if (skipdigits(pat + 8) == pat + patlen - 1)
Karsten Hopp db5d42
+ 		    /* "<buffer=123>" */
Karsten Hopp db5d42
  		    buflocal_nr = atoi((char *)pat + 8);
Karsten Hopp db5d42
  	    }
Karsten Hopp db5d42
  	}
Karsten Hopp db5d42
*** ../vim-7.4.636/src/version.c	2015-02-17 15:43:52.804426855 +0100
Karsten Hopp db5d42
--- src/version.c	2015-02-17 15:57:50.245559689 +0100
Karsten Hopp db5d42
***************
Karsten Hopp db5d42
*** 743,744 ****
Karsten Hopp db5d42
--- 743,746 ----
Karsten Hopp db5d42
  {   /* Add new patch number below this line */
Karsten Hopp db5d42
+ /**/
Karsten Hopp db5d42
+     637,
Karsten Hopp db5d42
  /**/
Karsten Hopp db5d42
Karsten Hopp db5d42
-- 
Karsten Hopp db5d42
"Marriage is when a man and woman become as one; the trouble starts
Karsten Hopp db5d42
when they try to decide which one"
Karsten Hopp db5d42
Karsten Hopp db5d42
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp db5d42
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp db5d42
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp db5d42
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///