commit aef31910222702c4cef8de17487f87b910a601f3
parent 83c23f274c89e31473fd13b93f287e1c7516a040
Author: Drew DeVault <sir@cmpwn.com>
Date: Mon, 19 Oct 2015 13:52:49 -0400
Merge pull request #196 from sce/catch_empty_command
commands: Gracefully handle empty commands.
Diffstat:
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git a/sway/commands.c b/sway/commands.c
@@ -1178,6 +1178,11 @@ enum cmd_status handle_command(char *_exec) {
// Split commands
cmd = argsep(&cmdlist, ",");
cmd += strspn(cmd, whitespace);
+ if (strcmp(cmd, "") == 0) {
+ sway_log(L_INFO, "Ignoring empty command.");
+ continue;
+ }
+
sway_log(L_INFO, "Handling command '%s'", cmd);
//TODO better handling of argv
int argc;