mirror of
https://github.com/git/git
synced 2024-08-25 02:35:46 +00:00
Merge branch 'jk/common-main'
Fix for a small regression in a topic already in 'master'. * jk/common-main: common-main: stop munging argv[0] path
This commit is contained in:
commit
95c2b13a5f
|
@ -33,7 +33,7 @@ int main(int argc, const char **argv)
|
|||
|
||||
git_setup_gettext();
|
||||
|
||||
argv[0] = git_extract_argv0_path(argv[0]);
|
||||
git_extract_argv0_path(argv[0]);
|
||||
|
||||
restore_sigpipe_to_default();
|
||||
|
||||
|
|
10
exec_cmd.c
10
exec_cmd.c
|
@ -38,21 +38,17 @@ char *system_path(const char *path)
|
|||
return strbuf_detach(&d, NULL);
|
||||
}
|
||||
|
||||
const char *git_extract_argv0_path(const char *argv0)
|
||||
void git_extract_argv0_path(const char *argv0)
|
||||
{
|
||||
const char *slash;
|
||||
|
||||
if (!argv0 || !*argv0)
|
||||
return NULL;
|
||||
return;
|
||||
|
||||
slash = find_last_dir_sep(argv0);
|
||||
|
||||
if (slash) {
|
||||
if (slash)
|
||||
argv0_path = xstrndup(argv0, slash - argv0);
|
||||
return slash + 1;
|
||||
}
|
||||
|
||||
return argv0;
|
||||
}
|
||||
|
||||
void git_set_argv_exec_path(const char *exec_path)
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
struct argv_array;
|
||||
|
||||
extern void git_set_argv_exec_path(const char *exec_path);
|
||||
extern const char *git_extract_argv0_path(const char *path);
|
||||
extern void git_extract_argv0_path(const char *path);
|
||||
extern const char *git_exec_path(void);
|
||||
extern void setup_path(void);
|
||||
extern const char **prepare_git_cmd(struct argv_array *out, const char **argv);
|
||||
|
|
Loading…
Reference in a new issue