[PATCH 38/40] Windows: TMP and TEMP environment variables specify a temporary directory.
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
---
path.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/path.c b/path.c
index 4260952..7f18539 100644
--- a/path.c
+++ b/path.c
@@ -75,6 +75,13 @@ int git_mkstemp(char *path, size_t len, const char *template)
size_t n;
tmp = getenv("TMPDIR");
+#ifdef __MINGW32__
+ /* on Windows it is TMP and TEMP */
+ if (!tmp)
+ tmp = getenv("TMP");
+ if (!tmp)
+ tmp = getenv("TEMP");
+#endif
if (!tmp)
tmp = "/tmp";
n = snprintf(path, len, "%s/%s", tmp, template);
--
1.5.4.1.126.ge5a7d