git-2.22.0/exec-cmd.c
/*
 * Resolves the executable path from argv[0], only if it is absolute.
 *
 * Returns 0 on success, -1 on failure.
 */
Resolves the executable path from argv[0], only if it is absolute.
Returns 0 on success, -1 on failure.
Resolves the executable path from argv [ 0 ] only if it is absolute . Returns 0 on success - 1 on failure .
static int git_get_exec_path_from_argv0(struct strbuf *buf, const char *argv0)
{
	const char *slash;
	if (!argv0 || !*argv0)
		return -1;
	slash = find_last_dir_sep(argv0);
	if (slash) {
		trace_printf("trace: resolved executable path from argv0: %s\n",
			     argv0);
		strbuf_add_absolute_path(buf, argv0);
		return 0;
	}
	return -1;
}
static int git_get_exec_path_from_argv0 ( struct strbuf * buf , const char * argv0 ) { const char * slash ; if ( ! argv0 || ! * argv0 ) return -1 ; slash = find_last_dir_sep ( argv0 ) ; if ( slash ) { trace_printf ( " \n " , argv0 ) ; strbuf_add_absolute_path ( buf , argv0 ) ; return 0 ; } return -1 ; }
Resolves the executable path from argv[0], only if it is absolute.
Resolves the executable path from argv [ 0 ] only if it is absolute .