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: v4.0~823 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F470%2Fhead;p=thirdparty%2Fccache.git Win32: make_relative_path also accept /c/users (#455) Patch copied from jd-gascuel@f3b85c9 --- 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