1
0
mirror of https://github.com/git/git.git synced 2024-11-19 08:04:11 +01:00

git wrapper: fix command name in an error message.

When the command execution by execv_git_cmd() fails with an errno
other than ENOENT, we used an uninitialized variable instead of
the string that holds the command name to report what failed.

Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Andreas Ericsson 2006-06-28 02:17:21 -07:00 committed by Junio C Hamano
parent 80f50749da
commit 33ebb8717f

3
git.c

@ -206,7 +206,6 @@ int main(int argc, const char **argv, char **envp)
{
const char *cmd = argv[0];
char *slash = strrchr(cmd, '/');
char git_command[PATH_MAX + 1];
const char *exec_path = NULL;
int done_alias = 0;
@ -313,7 +312,7 @@ int main(int argc, const char **argv, char **envp)
cmd_usage(0, exec_path, "'%s' is not a git-command", cmd);
fprintf(stderr, "Failed to run command '%s': %s\n",
git_command, strerror(errno));
cmd, strerror(errno));
return 1;
}