diff options
author | Drew DeVault <sir@cmpwn.com> | 2015-10-19 13:52:49 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2015-10-19 13:52:49 -0400 |
commit | aef31910222702c4cef8de17487f87b910a601f3 (patch) | |
tree | 223b4bf653a5a77b3940c28b541048c6029f4886 | |
parent | Merge pull request #195 from sce/get_socketpath (diff) | |
parent | commands: Gracefully handle empty commands. (diff) | |
download | sway-aef31910222702c4cef8de17487f87b910a601f3.tar.gz sway-aef31910222702c4cef8de17487f87b910a601f3.tar.zst sway-aef31910222702c4cef8de17487f87b910a601f3.zip |
Merge pull request #196 from sce/catch_empty_command
commands: Gracefully handle empty commands.
-rw-r--r-- | sway/commands.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sway/commands.c b/sway/commands.c index 5afddc4a..eb77c172 100644 --- a/sway/commands.c +++ b/sway/commands.c | |||
@@ -1178,6 +1178,11 @@ enum cmd_status handle_command(char *_exec) { | |||
1178 | // Split commands | 1178 | // Split commands |
1179 | cmd = argsep(&cmdlist, ","); | 1179 | cmd = argsep(&cmdlist, ","); |
1180 | cmd += strspn(cmd, whitespace); | 1180 | cmd += strspn(cmd, whitespace); |
1181 | if (strcmp(cmd, "") == 0) { | ||
1182 | sway_log(L_INFO, "Ignoring empty command."); | ||
1183 | continue; | ||
1184 | } | ||
1185 | |||
1181 | sway_log(L_INFO, "Handling command '%s'", cmd); | 1186 | sway_log(L_INFO, "Handling command '%s'", cmd); |
1182 | //TODO better handling of argv | 1187 | //TODO better handling of argv |
1183 | int argc; | 1188 | int argc; |