Mercurial > vim
diff src/ex_docmd.c @ 534:c6296b0ad9ea v7.0151
updated for version 7.0151
author | vimboss |
---|---|
date | Thu, 29 Sep 2005 18:26:07 +0000 |
parents | 7052f11a3dc9 |
children | 862863033fdd |
line wrap: on
line diff
--- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -5900,7 +5900,7 @@ parse_compl_arg(value, vallen, complp, a 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); }