Fix relative built-in paths to be relative to the command invocation
$(gitexecdir) (as defined in the Makefile) has gained another path component, but the relative paths in the MINGW section of the Makefile, which are interpreted relative to it, do not account for it. Instead of adding another ../ in front of the path, we change the code that constructs the absolute paths to do it relative to the command's directory, which is essentially $(bindir). We do it this way because we will also allow a relative $(gitexecdir) later. Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Sixt committed
Jul 21, 2008 at 21:19 UTC
966c6edd318f2e44dd150103ec2b6b7a53be58f0
2 files changed
+3
-3
Makefile
+1
-1
@@ -1315,7 +1315,7 @@ remove-dashes:
1315
### Installation rules
1316
1317
ifeq ($(firstword $(subst /, ,$(template_dir))),..)
1318
-template_instdir = $(gitexecdir)/$(template_dir)
1318
+template_instdir = $(bindir)/$(template_dir)
1319
else
1320
template_instdir = $(template_dir)
1321
endif
exec_cmd.c
+2
-2
@@ -43,9 +43,9 @@ static const char *builtin_exec_path(void)
43
44
const char *system_path(const char *path)
45
{
46
- if (!is_absolute_path(path)) {
46
+ if (!is_absolute_path(path) && argv0_path) {
47
struct strbuf d = STRBUF_INIT;
48
- strbuf_addf(&d, "%s/%s", git_exec_path(), path);
48
+ strbuf_addf(&d, "%s/%s", argv0_path, path);
49
path = strbuf_detach(&d, NULL);
50
}
51
return path;