From c346c020bf93d455dab917dd27d86afc78273dd2 Mon Sep 17 00:00:00 2001 From: Brian Ashworth Date: Wed, 19 Jun 2019 18:21:18 -0400 Subject: config: fix find_handler logic Without this change, the handlers listed in the config_handlers or command_handlers arrays (depending on reading or active) in commands.c would be valid subcommands. To make matters worse, they would also take precedence over the defined subcommand handlers. This corrects find_handler to only work on the handler array given instead of implicitly trying others. --- include/sway/commands.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/sway/commands.h') diff --git a/include/sway/commands.h b/include/sway/commands.h index e0cd94d1..641f2504 100644 --- a/include/sway/commands.h +++ b/include/sway/commands.h @@ -47,7 +47,8 @@ struct cmd_results *checkarg(int argc, const char *name, enum expected_args type, int val); struct cmd_handler *find_handler(char *line, struct cmd_handler *cmd_handlers, - int handlers_size); + size_t handlers_size); + /** * Parse and executes a command. * -- cgit v1.2.3