summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Ericsson <ae@op5.se>2006-06-28 09:17:21 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-06-28 10:20:51 (GMT)
commit33ebb8717f15a85615f712df125c37737062e1b2 (patch)
tree50db83d2ff64a8307df6795dbab809600943f39e
parent80f50749da3441502aabd5b6c5129c9eb3bdf870 (diff)
downloadgit-33ebb8717f15a85615f712df125c37737062e1b2.zip
git-33ebb8717f15a85615f712df125c37737062e1b2.tar.gz
git-33ebb8717f15a85615f712df125c37737062e1b2.tar.bz2
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>
-rw-r--r--git.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/git.c b/git.c
index 94e9a4a..94505c9 100644
--- a/git.c
+++ b/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;
}