@matheusbsbs / matheus-bagliano / commits / 33ebb8717f
Fork 0

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>

Andreas Ericsson committed Jun 28, 2006 at 02:17 UTC 33ebb8717f15a85615f712df125c37737062e1b2
1 file changed +1 -2
git.c
+1 -2
@@ -206,7 +206,6 @@ int main(int argc, const char **argv, char **envp)
206 {
207 const char *cmd = argv[0];
208 char *slash = strrchr(cmd, '/');
209 - char git_command[PATH_MAX + 1];
209 const char *exec_path = NULL;
210 int done_alias = 0;
211
@@ -313,7 +312,7 @@ int main(int argc, const char **argv, char **envp)
312 cmd_usage(0, exec_path, "'%s' is not a git-command", cmd);
313
314 fprintf(stderr, "Failed to run command '%s': %s\n",
316 - git_command, strerror(errno));
315 + cmd, strerror(errno));
316
317 return 1;
318 }