summaryrefslogtreecommitdiff
path: root/src/ex_docmd.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2005-09-29 18:26:07 +0000
committerBram Moolenaar <Bram@vim.org>2005-09-29 18:26:07 +0000
commit482aaeb058a3c05235148d22f6c511416da009fb (patch)
treeb9c63e97ec2826bfeea041afe176a04763dbcfa8 /src/ex_docmd.c
parent4463f296d0744915fa25dbd893821833043f9a25 (diff)
downloadvim-git-482aaeb058a3c05235148d22f6c511416da009fb.tar.gz
updated for version 7.0151v7.0151
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r--src/ex_docmd.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index f88fbf815..724238179 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -5900,7 +5900,7 @@ parse_compl_arg(value, vallen, complp, argt, compl_arg)
for (i = 0; command_complete[i].expand != 0; ++i)
{
- if (STRLEN(command_complete[i].name) == valend
+ if ((int)STRLEN(command_complete[i].name) == valend
&& STRNCMP(value, command_complete[i].name, valend) == 0)
{
*complp = command_complete[i].expand;
@@ -9179,15 +9179,21 @@ makeopens(fd, dirnow)
*/
if (ssop_flags & SSOP_SESDIR)
{
- if (put_line(fd, "exe \"cd \" . expand(\"<sfile>:p:h\")") == FAIL)
+ if (put_line(fd, "exe \"cd \" . escape(expand(\"<sfile>:p:h\"), ' ')")
+ == FAIL)
return FAIL;
}
else if (ssop_flags & SSOP_CURDIR)
{
sname = home_replace_save(NULL, globaldir != NULL ? globaldir : dirnow);
if (sname == NULL
- || fprintf(fd, "cd %s", sname) < 0 || put_eol(fd) == FAIL)
+ || fputs("cd ", fd) < 0
+ || ses_put_fname(fd, sname, &ssop_flags) == FAIL
+ || put_eol(fd) == FAIL)
+ {
+ vim_free(sname);
return FAIL;
+ }
vim_free(sname);
}