aboutsummaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
Diffstat (limited to 'config.c')
-rw-r--r--config.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/config.c b/config.c
index 0b0c9bd05..498259ebe 100644
--- a/config.c
+++ b/config.c
@@ -484,10 +484,9 @@ const char *git_etc_gitconfig(void)
system_wide = ETC_GITCONFIG;
if (!is_absolute_path(system_wide)) {
/* interpret path relative to exec-dir */
- const char *exec_path = git_exec_path();
- system_wide = strdup(prefix_filename(exec_path,
- strlen(exec_path),
- system_wide));
+ struct strbuf d = STRBUF_INIT;
+ strbuf_addf(&d, "%s/%s", git_exec_path(), system_wide);
+ system_wide = strbuf_detach(&d, NULL);
}
}
return system_wide;