summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2014-01-10 15:53:13 +0100
committerBram Moolenaar <Bram@vim.org>2014-01-10 15:53:13 +0100
commitbd2dc34774c3753b2953a3bffaf35d5793d2575c (patch)
treeaf3afe045074e0d5122566a7f61a1d7e1956317d
parent4ea924e0a567c5026a25fba2b02dd6eaf9efcb89 (diff)
updated for version 7.4.139v7.4.139
Problem: Crash when using :cd in autocommand. (François Ingelrest) Solution: Set w_localdir to NULL after freeing it. (Dominique Pelle)
-rw-r--r--src/ex_docmd.c2
-rw-r--r--src/version.c2
-rw-r--r--src/window.c4
3 files changed, 5 insertions, 3 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index bf5f81cca9..17c5606e6d 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -8228,6 +8228,7 @@ post_chdir(local)
int local;
{
vim_free(curwin->w_localdir);
+ curwin->w_localdir = NULL;
if (local)
{
/* If still in global directory, need to remember current
@@ -8244,7 +8245,6 @@ post_chdir(local)
* name. */
vim_free(globaldir);
globaldir = NULL;
- curwin->w_localdir = NULL;
}
shorten_fnames(TRUE);
diff --git a/src/version.c b/src/version.c
index 1fda7d5280..d8c0123415 100644
--- a/src/version.c
+++ b/src/version.c
@@ -739,6 +739,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 139,
+/**/
138,
/**/
137,
diff --git a/src/window.c b/src/window.c
index 48745f0601..66cee28cec 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1216,8 +1216,8 @@ win_init(newp, oldp, flags)
else
copy_loclist(oldp, newp);
#endif
- if (oldp->w_localdir != NULL)
- newp->w_localdir = vim_strsave(oldp->w_localdir);
+ newp->w_localdir = (oldp->w_localdir == NULL)
+ ? NULL : vim_strsave(oldp->w_localdir);
/* copy tagstack and folds */
for (i = 0; i < oldp->w_tagstacklen; i++)