Skip to content

Commit

Permalink
mingw: deprecate old-style runtime-prefix handling in interpolate_path()
Browse files Browse the repository at this point in the history
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 <johannes.schindelin@gmx.de>
  • Loading branch information
dscho authored and vdye committed Nov 15, 2021
1 parent 89c1927 commit 28fdfd8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions path.c
Expand Up @@ -739,6 +739,12 @@ char *interpolate_path(const char *path, int real_home)
if (skip_prefix(path, "%(prefix)/", &path))
return system_path(path);

#ifdef __MINGW32__
if (path[0] == '/') {
warning(_("encountered old-style '%s' that should be '%%(prefix)%s'"), path, path);
return system_path(path + 1);
}
#endif
if (path[0] == '~') {
const char *first_slash = strchrnul(path, '/');
const char *username = path + 1;
Expand Down

0 comments on commit 28fdfd8

Please sign in to comment.