mirror of
https://github.com/swaywm/sway.git
synced 2024-12-29 16:36:26 +01:00
Fail if unknown output subcommand
This commit is contained in:
parent
4d389f8b65
commit
9254c5a93f
1 changed files with 5 additions and 2 deletions
|
@ -192,7 +192,7 @@ struct cmd_results *cmd_output(int argc, char **argv) {
|
|||
|
||||
char *src = join_args(argv + i, j);
|
||||
if (wordexp(src, &p, 0) != 0 || p.we_wordv[0] == NULL) {
|
||||
error = cmd_results_new(CMD_INVALID, "output", "Invalid syntax (%s)", src);
|
||||
error = cmd_results_new(CMD_INVALID, "output", "Invalid syntax (%s).", src);
|
||||
goto fail;
|
||||
}
|
||||
free(src);
|
||||
|
@ -213,7 +213,7 @@ struct cmd_results *cmd_output(int argc, char **argv) {
|
|||
}
|
||||
}
|
||||
if (!src || access(src, F_OK) == -1) {
|
||||
error = cmd_results_new(CMD_INVALID, "output", "Background file unreadable (%s)", src);
|
||||
error = cmd_results_new(CMD_INVALID, "output", "Background file unreadable (%s).", src);
|
||||
wordfree(&p);
|
||||
goto fail;
|
||||
}
|
||||
|
@ -227,6 +227,9 @@ struct cmd_results *cmd_output(int argc, char **argv) {
|
|||
|
||||
i += j;
|
||||
}
|
||||
} else {
|
||||
error = cmd_results_new(CMD_INVALID, "output", "Invalid output subcommand: %s.", command);
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue