Add #ifdef __MINGW32__ in two places

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
This commit is contained in:
Johannes Sixt
2007-12-08 23:09:34 +01:00
parent 31cda49348
commit 71d36f4301
2 changed files with 8 additions and 1 deletions

View File

@@ -523,8 +523,13 @@ struct child_process *git_connect(int fd[2], const char *url_orig,
end = host;
path = strchr(end, c);
#ifdef __MINGW32__
/* host must have at least 2 chars to catch DOS C:/path */
if (path && path - end > 1) {
if (path && path - end > 1)
#else
if (path)
#endif
{
if (c == ':') {
protocol = PROTO_SSH;
*path++ = '\0';

2
path.c
View File

@@ -75,11 +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);