MCPcopy Index your code
hub / github.com/git/git / git_get_exec_path_from_argv0

Function git_get_exec_path_from_argv0

exec-cmd.c:70–85  ·  view source on GitHub ↗

* Resolves the executable path from argv[0], only if it is absolute. * * Returns 0 on success, -1 on failure. */

Source from the content-addressed store, hash-verified

68 * Returns 0 on success, -1 on failure.
69 */
70static int git_get_exec_path_from_argv0(struct strbuf *buf, const char *argv0)
71{
72 const char *slash;
73
74 if (!argv0 || !*argv0)
75 return -1;
76
77 slash = find_last_dir_sep(argv0);
78 if (slash) {
79 trace_printf("trace: resolved executable path from argv0: %s\n",
80 argv0);
81 strbuf_add_absolute_path(buf, argv0);
82 return 0;
83 }
84 return -1;
85}
86
87#ifdef PROCFS_EXECUTABLE_PATH
88/*

Callers 1

exec-cmd.cFile · 0.85

Calls 1

strbuf_add_absolute_pathFunction · 0.85

Tested by

no test coverage detected