Merge branch 'deprecate-old-runtime-prefix-path-interpolation'

Previously, we interpolated paths in config variables that start with a
forward-slash as relative to the runtime prefix. This was not portable
and has been replaced with `%(prefix)/`.

Let's warn users when they use the now-deprecated form.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
Johannes Schindelin 2021-10-15 15:12:48 +02:00
Родитель 4d5ae614b2 18a6714351
Коммит 79dd42a45d
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))
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;