diff options
Diffstat (limited to 'exec_cmd.c')
-rw-r--r-- | exec_cmd.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/exec_cmd.c b/exec_cmd.c index 698e7526c4..e85f0fd8d8 100644 --- a/exec_cmd.c +++ b/exec_cmd.c @@ -6,7 +6,7 @@ static const char *argv_exec_path; static const char *argv0_path; -const char *system_path(const char *path) +char *system_path(const char *path) { #ifdef RUNTIME_PREFIX static const char *prefix; @@ -16,7 +16,7 @@ const char *system_path(const char *path) struct strbuf d = STRBUF_INIT; if (is_absolute_path(path)) - return path; + return xstrdup(path); #ifdef RUNTIME_PREFIX assert(argv0_path); @@ -34,8 +34,7 @@ const char *system_path(const char *path) #endif strbuf_addf(&d, "%s/%s", prefix, path); - path = strbuf_detach(&d, NULL); - return path; + return strbuf_detach(&d, NULL); } const char *git_extract_argv0_path(const char *argv0) @@ -97,7 +96,6 @@ void setup_path(void) struct strbuf new_path = STRBUF_INIT; add_path(&new_path, git_exec_path()); - add_path(&new_path, argv0_path); if (old_path) strbuf_addstr(&new_path, old_path); |