Skip to content

Commit 6fd0475

Browse files
dschoGit for Windows Build Agent
authored andcommitted
mingw: deprecate old-style runtime-prefix handling in interpolate_path()
On Windows, an absolute POSIX path needs to be turned into a Windows one. We used to interpret paths starting with a single `/` as relative to the runtime-prefix, but now these need to be prefixed with `%(prefix)/`. Let's warn for now, but still handle it. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 485b2ea commit 6fd0475

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

path.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,12 @@ char *interpolate_path(const char *path, int real_home)
746746
if (skip_prefix(path, "%(prefix)/", &path))
747747
return system_path(path);
748748

749+
#ifdef __MINGW32__
750+
if (path[0] == '/') {
751+
warning(_("encountered old-style '%s' that should be '%%(prefix)/%s'"), path, path);
752+
return system_path(path + 1);
753+
}
754+
#endif
749755
if (path[0] == '~') {
750756
const char *first_slash = strchrnul(path, '/');
751757
const char *username = path + 1;

0 commit comments

Comments
 (0)