81c2858
To: vim-dev@vim.org
81c2858
Subject: Patch 7.2.154
81c2858
Fcc: outbox
81c2858
From: Bram Moolenaar <Bram@moolenaar.net>
81c2858
Mime-Version: 1.0
81c2858
Content-Type: text/plain; charset=ISO-8859-1
81c2858
Content-Transfer-Encoding: 8bit
81c2858
------------
81c2858
81c2858
Patch 7.2.154 (after 7.2.132)
81c2858
Problem:    ":cd" is still possible in a SwapExists autocmd.
81c2858
Solution:   Set allbuf_lock in do_swapexists().
81c2858
Files:	    src/memline.c
81c2858
81c2858
81c2858
*** ../vim-7.2.153/src/memline.c	Wed Apr 22 15:37:12 2009
81c2858
--- src/memline.c	Wed Apr 22 15:54:48 2009
81c2858
***************
81c2858
*** 3771,3778 ****
81c2858
      set_vim_var_string(VV_SWAPCHOICE, NULL, -1);
81c2858
  
81c2858
      /* Trigger SwapExists autocommands with <afile> set to the file being
81c2858
!      * edited. */
81c2858
      apply_autocmds(EVENT_SWAPEXISTS, buf->b_fname, NULL, FALSE, NULL);
81c2858
  
81c2858
      set_vim_var_string(VV_SWAPNAME, NULL, -1);
81c2858
  
81c2858
--- 3771,3780 ----
81c2858
      set_vim_var_string(VV_SWAPCHOICE, NULL, -1);
81c2858
  
81c2858
      /* Trigger SwapExists autocommands with <afile> set to the file being
81c2858
!      * edited.  Disallow changing directory here. */
81c2858
!     ++allbuf_lock;
81c2858
      apply_autocmds(EVENT_SWAPEXISTS, buf->b_fname, NULL, FALSE, NULL);
81c2858
+     --allbuf_lock;
81c2858
  
81c2858
      set_vim_var_string(VV_SWAPNAME, NULL, -1);
81c2858
  
81c2858
***************
81c2858
*** 3798,3803 ****
81c2858
--- 3800,3806 ----
81c2858
   *
81c2858
   * Note: If BASENAMELEN is not correct, you will get error messages for
81c2858
   *	 not being able to open the swapfile
81c2858
+  * Note: May trigger SwapExists autocmd, pointers may change!
81c2858
   */
81c2858
      static char_u *
81c2858
  findswapname(buf, dirp, old_fname)
81c2858
*** ../vim-7.2.153/src/version.c	Wed Apr 22 15:37:12 2009
81c2858
--- src/version.c	Wed Apr 22 15:55:48 2009
81c2858
***************
81c2858
*** 678,679 ****
81c2858
--- 678,681 ----
81c2858
  {   /* Add new patch number below this line */
81c2858
+ /**/
81c2858
+     154,
81c2858
  /**/
81c2858
81c2858
-- 
81c2858
ARTHUR:  Be quiet!
81c2858
DENNIS:  Well you can't expect to wield supreme executive power just 'cause
81c2858
         some watery tart threw a sword at you!
81c2858
ARTHUR:  Shut up!
81c2858
DENNIS:  I mean, if I went around sayin' I was an empereror just because some
81c2858
         moistened bint had lobbed a scimitar at me they'd put me away!
81c2858
                                  The Quest for the Holy Grail (Monty Python)
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    ///