summaryrefslogtreecommitdiff
path: root/exec_cmd.c
diff options
context:
space:
mode:
authorJohannes Sixt <johannes.sixt@telecom.at>2008-07-21 19:19:53 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-07-26 00:41:13 (GMT)
commit966c6edd318f2e44dd150103ec2b6b7a53be58f0 (patch)
tree7b5182b62fc2d4fbf6ad6031f0017dfbc559487e /exec_cmd.c
parente1464ca7bb0d705210ba7198f004b2fb2b807e12 (diff)
downloadgit-966c6edd318f2e44dd150103ec2b6b7a53be58f0.zip
git-966c6edd318f2e44dd150103ec2b6b7a53be58f0.tar.gz
git-966c6edd318f2e44dd150103ec2b6b7a53be58f0.tar.bz2
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>
Diffstat (limited to 'exec_cmd.c')
-rw-r--r--exec_cmd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/exec_cmd.c b/exec_cmd.c
index dedb01d..45f92eb 100644
--- a/exec_cmd.c
+++ b/exec_cmd.c
@@ -43,9 +43,9 @@ static const char *builtin_exec_path(void)
const char *system_path(const char *path)
{
- if (!is_absolute_path(path)) {
+ if (!is_absolute_path(path) && argv0_path) {
struct strbuf d = STRBUF_INIT;
- strbuf_addf(&d, "%s/%s", git_exec_path(), path);
+ strbuf_addf(&d, "%s/%s", argv0_path, path);
path = strbuf_detach(&d, NULL);
}
return path;