From 94d81357c514f83b8d4d1cfa3466ea7535e2c20f 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 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/path.c b/path.c index da8b655730..7877a7a54a 100644 --- a/path.c +++ b/path.c @@ -10,6 +10,7 @@ #include "submodule-config.h" #include "path.h" #include "packfile.h" +#include "exec_cmd.h" static int get_st_mode_bits(const char *path, int *mode) { @@ -708,6 +709,10 @@ char *expand_user_path(const char *path, int real_home) if (path == NULL) goto return_null; +#ifdef __MINGW32__ + if (path[0] == '/') + return system_path(path + 1); +#endif if (path[0] == '~') { const char *first_slash = strchrnul(path, '/'); const char *username = path + 1;