mirror of
https://github.com/git/git.git
synced 2026-03-13 10:23:30 +01:00
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.
This commit is contained in:
5
path.c
5
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;
|
||||
|
||||
Reference in New Issue
Block a user