From 79e57d9ec118e119df59752bd06de6ba60aa48bc Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Fri, 11 Dec 2015 06:59:13 +0100 Subject: [PATCH] mingw: handle absolute paths in expand_user_path() On Windows, an absolute POSIX path needs to be turned into a Windows one. Signed-off-by: Johannes Schindelin --- path.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/path.c b/path.c index 38f2ebd6bf..65a7847206 100644 --- a/path.c +++ b/path.c @@ -350,6 +350,10 @@ char *expand_user_path(const char *path) if (path == NULL) goto return_null; +#ifdef __MINGW32__ + if (path[0] == '/') + return system_path((*result) + 1); +#endif if (path[0] == '~') { const char *first_slash = strchrnul(path, '/'); const char *username = path + 1;