From 1fa9f0c8130177578020cdb89b9c93792f42400e Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Wed, 28 Aug 2019 19:07:21 +0200 Subject: [PATCH] Win32: make_relative_path also accept /c/users (#455) Patch copied from jd-gascuel@f3b85c9 --- src/ccache.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/ccache.cpp b/src/ccache.cpp index 264335319..8568d405a 100644 --- a/src/ccache.cpp +++ b/src/ccache.cpp @@ -772,7 +772,15 @@ make_relative_path(char* path) #ifdef _WIN32 if (path[0] == '/') { - path++; // Skip leading slash. + char *p = NULL; + if (isalpha(path[1]) && path[2] == '/') { + // Transform /c/path... to c:/path... + p = format("%c:/%s", path[1], &path[3]); + } else { + p = x_strdup(path+1); // Skip leading slash. + } + free(path); + path = p; } #endif -- 2.47.2