From: Johannes Sixt Date: Wed, 27 Feb 2008 18:55:01 GMT Subject: [PATCH 38/40] Windows: TMP and TEMP environment variables specify a temporary directory. Message-ID: <1204138503-6126-39-git-send-email-johannes.sixt@telecom.at> In-Reply-To: <1204138503-6126-1-git-send-email-johannes.sixt@telecom.at> Signed-off-by: Johannes Sixt --- 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