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 <johannes.schindelin@gmx.de>
This commit is contained in:
Johannes Schindelin 2015-12-11 06:59:13 +01:00
Родитель 3af6e724d3
Коммит 8e4630867d
1 изменённых файлов: 6 добавлений и 0 удалений

6
path.c
Просмотреть файл

@ -739,6 +739,12 @@ char *interpolate_path(const char *path, int real_home)
if (skip_prefix(path, "%(prefix)/", &path)) if (skip_prefix(path, "%(prefix)/", &path))
return system_path(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] == '~') { if (path[0] == '~') {
const char *first_slash = strchrnul(path, '/'); const char *first_slash = strchrnul(path, '/');
const char *username = path + 1; const char *username = path + 1;