mirror of
https://github.com/tmux/tmux.git
synced 2025-01-12 03:08:46 +00:00
Don't overwrite error message when it is available in
cmd_string_parse. Reported by Jimi Damon in GitHub issue 975.
This commit is contained in:
parent
dec00d3579
commit
af93453190
12
cmd-string.c
12
cmd-string.c
@ -159,21 +159,19 @@ cmd_string_parse(const char *s, const char *file, u_int line, char **cause)
|
|||||||
char **argv;
|
char **argv;
|
||||||
|
|
||||||
*cause = NULL;
|
*cause = NULL;
|
||||||
if (cmd_string_split(s, &argc, &argv) != 0)
|
if (cmd_string_split(s, &argc, &argv) != 0) {
|
||||||
goto error;
|
xasprintf(cause, "invalid or unknown command: %s", s);
|
||||||
|
return (NULL);
|
||||||
|
}
|
||||||
if (argc != 0) {
|
if (argc != 0) {
|
||||||
cmdlist = cmd_list_parse(argc, argv, file, line, cause);
|
cmdlist = cmd_list_parse(argc, argv, file, line, cause);
|
||||||
if (cmdlist == NULL) {
|
if (cmdlist == NULL) {
|
||||||
cmd_free_argv(argc, argv);
|
cmd_free_argv(argc, argv);
|
||||||
goto error;
|
return (NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cmd_free_argv(argc, argv);
|
cmd_free_argv(argc, argv);
|
||||||
return (cmdlist);
|
return (cmdlist);
|
||||||
|
|
||||||
error:
|
|
||||||
xasprintf(cause, "invalid or unknown command: %s", s);
|
|
||||||
return (NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user