aboutsummaryrefslogtreecommitdiff
path: root/sway/commands.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2017-10-08 10:02:52 -0400
committerGitHub <noreply@github.com>2017-10-08 10:02:52 -0400
commit43161a7e178b59b6bff3f210f46e21e8bf67e066 (patch)
tree8550777f6cffe2f692831b5edb77c45c2867adc5 /sway/commands.c
parent97daffea58b880c9b62dde02cd2dcd3c09f362eb (diff)
parent61005c3bdab54b2ee84365fed4894c0e34da6c5b (diff)
Merge pull request #1387 from lbonn/ipc-work
ipc: various fixes for i3 compat
Diffstat (limited to 'sway/commands.c')
-rw-r--r--sway/commands.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sway/commands.c b/sway/commands.c
index d55d9a96..c7dbf731 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -458,7 +458,11 @@ struct cmd_results *handle_command(char *_exec, enum command_context context) {
if (!containers) {
current_container = get_focused_container(&root_container);
} else if (containers->length == 0) {
- break;
+ if (results) {
+ free_cmd_results(results);
+ }
+ results = cmd_results_new(CMD_FAILURE, argv[0], "No matching container");
+ goto cleanup;
} else {
current_container = (swayc_t *)containers->items[i];
}