From 4694606a42710234433aec3cedfe7cad3d387e25 Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Thu, 24 May 2007 22:28:41 +0200 Subject: [PATCH] Check TMP and TEMP environment variables in addition to TMPDIR. Windows uses TMP and TEMP, but we still check for TMPDIR, which some scripts may set. --- path.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/path.c b/path.c index ced3a7c586..29570ee52a 100644 --- a/path.c +++ b/path.c @@ -73,7 +73,10 @@ int git_mkstemp(char *path, size_t len, const char *template) { char *env, *pch = path; - if ((env = getenv("TMPDIR")) == NULL) { + if ((env = getenv("TMPDIR")) == NULL && + /* on Windows it is TMP and TEMP */ + (env = getenv("TMP")) == NULL && + (env = getenv("TEMP")) == NULL) { strcpy(pch, "/tmp/"); len -= 5; pch += 5;