From 9254c5a93f1a38612d5391e34e4fe3b6c9e433a7 Mon Sep 17 00:00:00 2001 From: emersion Date: Thu, 14 Dec 2017 00:50:01 +0100 Subject: [PATCH] Fail if unknown output subcommand --- sway/commands/output.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sway/commands/output.c b/sway/commands/output.c index daaacad7e..16b711f19 100644 --- a/sway/commands/output.c +++ b/sway/commands/output.c @@ -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; } }