From: Cristian Adam Date: Wed, 28 Aug 2019 17:07:21 +0000 (+0200) Subject: Win32: make_relative_path also accept /c/users (#455) X-Git-Tag: v3.7.4~3 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=93322f0acf4979b1341706342d6dc40d5960b043;p=thirdparty%2Fccache.git Win32: make_relative_path also accept /c/users (#455) Patch copied from jd-gascuel@f3b85c9 (cherry picked from commit 1fa9f0c8130177578020cdb89b9c93792f42400e) --- diff --git a/src/ccache.c b/src/ccache.c index ca3b961ab..6204ce212 100644 --- a/src/ccache.c +++ b/src/ccache.c @@ -791,7 +791,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