summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-08-02 17:08:13 +0200
committerBram Moolenaar <Bram@vim.org>2013-08-02 17:08:13 +0200
commit4008f4fb08f969c87e8f13bd9e019790757e08ad (patch)
tree08e3f21f12fbcb213bc83236d6b5ba7a01d1b4ca
parentaee1f4a5b5065da6602fb30e01529644e85eb036 (diff)
downloadvim-git-4008f4fb08f969c87e8f13bd9e019790757e08ad.tar.gz
updated for version 7.4b.008v7.4b.008
Problem: 'autochdir' causes setbufvar() to change the current directory. (Ben Fritz) Solution: When disabling autocommands also reset 'acd' temporarily. (Christian Brabandt)
-rw-r--r--src/fileio.c10
-rw-r--r--src/version.c2
2 files changed, 10 insertions, 2 deletions
diff --git a/src/fileio.c b/src/fileio.c
index 731a7b183..20f082b22 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -8861,6 +8861,7 @@ aucmd_prepbuf(aco, buf)
#ifdef FEAT_WINDOWS
int save_ea;
#endif
+ int save_acd;
/* Find a window that is for the new buffer */
if (buf == curbuf) /* be quick when buf is curbuf */
@@ -8909,11 +8910,10 @@ aucmd_prepbuf(aco, buf)
aucmd_win->w_s = &buf->b_s;
++buf->b_nwindows;
win_init_empty(aucmd_win); /* set cursor and topline to safe values */
- vim_free(aucmd_win->w_localdir);
- aucmd_win->w_localdir = NULL;
/* Make sure w_localdir and globaldir are NULL to avoid a chdir() in
* win_enter_ext(). */
+ vim_free(aucmd_win->w_localdir);
aucmd_win->w_localdir = NULL;
aco->globaldir = globaldir;
globaldir = NULL;
@@ -8926,9 +8926,15 @@ aucmd_prepbuf(aco, buf)
make_snapshot(SNAP_AUCMD_IDX);
save_ea = p_ea;
p_ea = FALSE;
+
+ /* Prevent chdir() call in win_enter_ext(), through do_autochdir(). */
+ save_acd = p_acd;
+ p_acd = FALSE;
+
(void)win_split_ins(0, WSP_TOP, aucmd_win, 0);
(void)win_comp_pos(); /* recompute window positions */
p_ea = save_ea;
+ p_acd = save_acd;
unblock_autocmds();
#endif
curwin = aucmd_win;
diff --git a/src/version.c b/src/version.c
index d34ed63dd..22fc9b961 100644
--- a/src/version.c
+++ b/src/version.c
@@ -728,6 +728,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 8,
+/**/
7,
/**/
6,