From 1f478cebeb929332e90c1b50de4b8a4f311a0df2 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Wed, 29 Mar 2017 18:29:46 +0200 Subject: [PATCH] win: tempname(): Use $TMPDIR if defined. --- runtime/doc/change.txt | 4 ++-- src/nvim/os/win_defs.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt index c8576d83e8..e0974b103c 100644 --- a/runtime/doc/change.txt +++ b/runtime/doc/change.txt @@ -601,8 +601,8 @@ all files in it are deleted. When Vim has the setuid bit set this may cause problems, the temp file is owned by the setuid user but the filter command probably runs as the original user. Directory for temporary files is created in the first suitable directory of: -For Unix: $TMPDIR, /tmp, current-dir, $HOME. -For MS-Windows: $TMP, $TEMP, $USERPROFILE, current-dir. + Unix: $TMPDIR, /tmp, current-dir, $HOME. + Windows: $TMPDIR, $TMP, $TEMP, $USERPROFILE, current-dir. diff --git a/src/nvim/os/win_defs.h b/src/nvim/os/win_defs.h index 827fb2f247..7c980c3768 100644 --- a/src/nvim/os/win_defs.h +++ b/src/nvim/os/win_defs.h @@ -19,7 +19,7 @@ #define NAME_MAX _MAX_PATH -#define TEMP_DIR_NAMES { "$TMP", "$TEMP", "$USERPROFILE", "" } +#define TEMP_DIR_NAMES { "$TMPDIR", "$TMP", "$TEMP", "$USERPROFILE", "" } #define TEMP_FILE_PATH_MAXLEN _MAX_PATH #define FNAME_ILLEGAL "\"*?><|"