81c2858
To: vim-dev@vim.org
81c2858
Subject: Patch 7.2.202
81c2858
Fcc: outbox
81c2858
From: Bram Moolenaar <Bram@moolenaar.net>
81c2858
Mime-Version: 1.0
81c2858
Content-Type: text/plain; charset=UTF-8
81c2858
Content-Transfer-Encoding: 8bit
81c2858
------------
81c2858
81c2858
Patch 7.2.202
81c2858
Problem:    BufWipeout autocommand that edits another buffer causes problems.
81c2858
Solution:   Check for the situation, give an error and quit the operation.
81c2858
Files:	    src/fileio.c
81c2858
81c2858
81c2858
*** ../vim-7.2.201/src/fileio.c	2009-05-16 17:29:37.000000000 +0200
81c2858
--- src/fileio.c	2009-06-11 21:22:37.000000000 +0200
81c2858
***************
81c2858
*** 4824,4829 ****
81c2858
--- 4824,4831 ----
81c2858
      char_u	*sfname;
81c2858
  {
81c2858
  #ifdef FEAT_AUTOCMD
81c2858
+     buf_T	*buf = curbuf;
81c2858
+ 
81c2858
      /* It's like the unnamed buffer is deleted.... */
81c2858
      if (curbuf->b_p_bl)
81c2858
  	apply_autocmds(EVENT_BUFDELETE, NULL, NULL, FALSE, curbuf);
81c2858
***************
81c2858
*** 4832,4837 ****
81c2858
--- 4834,4845 ----
81c2858
      if (aborting())	    /* autocmds may abort script processing */
81c2858
  	return FAIL;
81c2858
  # endif
81c2858
+     if (curbuf != buf)
81c2858
+     {
81c2858
+ 	/* We are in another buffer now, don't do the renaming. */
81c2858
+ 	EMSG(_(e_auchangedbuf));
81c2858
+ 	return FAIL;
81c2858
+     }
81c2858
  #endif
81c2858
  
81c2858
      if (setfname(curbuf, fname, sfname, FALSE) == OK)
81c2858
*** ../vim-7.2.201/src/version.c	2009-06-16 15:23:07.000000000 +0200
81c2858
--- src/version.c	2009-06-16 15:28:31.000000000 +0200
81c2858
***************
81c2858
*** 678,679 ****
81c2858
--- 678,681 ----
81c2858
  {   /* Add new patch number below this line */
81c2858
+ /**/
81c2858
+     202,
81c2858
  /**/
81c2858
81c2858
-- 
81c2858
How To Keep A Healthy Level Of Insanity:
81c2858
14. Put mosquito netting around your work area. Play a tape of jungle
81c2858
    sounds all day.
81c2858
81c2858
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
81c2858
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
81c2858
\\\        download, build and distribute -- http://www.A-A-P.org        ///
81c2858
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///