Add vim_gettempdir(), remove global vim_tempdir

vim_gettempdir() and vim_maketempdir() was extracted from
vim_tempname().
This commit is contained in:
Pavel Platto
2014-06-21 14:07:51 +03:00
committed by Nicolas Hillegeer
parent 29e0cd1571
commit 8cfa7b3d15
3 changed files with 49 additions and 39 deletions

View File

@@ -893,11 +893,11 @@ void ex_diffpatch(exarg_T *eap)
|| (os_chdir((char *)dirbuf) != 0)) {
dirbuf[0] = NUL;
} else {
if (vim_tempdir != NULL) {
ignored = os_chdir((char *)vim_tempdir);
} else {
ignored = os_chdir("/tmp");
char *tempdir = (char *)vim_gettempdir();
if (tempdir == NULL) {
tempdir = "/tmp";
}
os_chdir(tempdir);
shorten_fnames(TRUE);
}
#endif // ifdef UNIX