From b65178b66bf36368da69dd39bcf6f6a7525b8f56 Mon Sep 17 00:00:00 2001
From: Johannes Schindelin <johannes.schindelin@gmx.de>
Date: Fri, 11 Dec 2015 06:59:13 +0100
Subject: [PATCH] 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>
---
 path.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/path.c b/path.c
index f062235d94cb0d..782bfd31300da6 100644
--- a/path.c
+++ b/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;