diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2021-03-03 15:14:50 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2021-03-03 15:14:50 +0900 |
commit | 05f24ec36f06d580f7fb566261f4a52cde129e76 (patch) | |
tree | 1de7b1401952609b4a78879caea64c748f7c3d74 /exec_cmd.c | |
parent | 1d03f0dffab250aeffd10eba0368b88cf61c6e6b (diff) | |
download | git-05f24ec36f06d580f7fb566261f4a52cde129e76.tar.gz git-05f24ec36f06d580f7fb566261f4a52cde129e76.tar.bz2 git-05f24ec36f06d580f7fb566261f4a52cde129e76.zip |
Imported Upstream version 2.3.0upstream/2.3.0
Diffstat (limited to 'exec_cmd.c')
-rw-r--r-- | exec_cmd.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -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) |