diff --git a/connect.c b/connect.c index c1483bf4f8..12903986f3 100644 --- a/connect.c +++ b/connect.c @@ -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'; diff --git a/path.c b/path.c index e264bb34a9..7f1853939d 100644 --- a/path.c +++ b/path.c @@ -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);