diff options
author | Ryan Dwyer <RyanDwyer@users.noreply.github.com> | 2018-12-09 21:50:19 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-09 21:50:19 +1000 |
commit | b61a936c8060bc4ac4320a5f76fd98b5042e5e41 (patch) | |
tree | 279a5554686d6e862282c943bda50787b69711e1 /sway/main.c | |
parent | Merge pull request #3264 from ianyfan/resize-list (diff) | |
parent | list.c: rename free_flat_list to list_free_items_and_destroy (diff) | |
download | sway-b61a936c8060bc4ac4320a5f76fd98b5042e5e41.tar.gz sway-b61a936c8060bc4ac4320a5f76fd98b5042e5e41.tar.zst sway-b61a936c8060bc4ac4320a5f76fd98b5042e5e41.zip |
Merge pull request #3271 from ianyfan/list-cleanup
list.c: Remove list_foreach
Diffstat (limited to 'sway/main.c')
-rw-r--r-- | sway/main.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sway/main.c b/sway/main.c index a74183fe..f70e751d 100644 --- a/sway/main.c +++ b/sway/main.c | |||
@@ -393,13 +393,12 @@ int main(int argc, char **argv) { | |||
393 | while (config->cmd_queue->length) { | 393 | while (config->cmd_queue->length) { |
394 | char *line = config->cmd_queue->items[0]; | 394 | char *line = config->cmd_queue->items[0]; |
395 | list_t *res_list = execute_command(line, NULL, NULL); | 395 | list_t *res_list = execute_command(line, NULL, NULL); |
396 | while (res_list->length) { | 396 | for (int i = 0; i < res_list->length; ++i) { |
397 | struct cmd_results *res = res_list->items[0]; | 397 | struct cmd_results *res = res_list->items[i]; |
398 | if (res->status != CMD_SUCCESS) { | 398 | if (res->status != CMD_SUCCESS) { |
399 | wlr_log(WLR_ERROR, "Error on line '%s': %s", line, res->error); | 399 | wlr_log(WLR_ERROR, "Error on line '%s': %s", line, res->error); |
400 | } | 400 | } |
401 | free_cmd_results(res); | 401 | free_cmd_results(res); |
402 | list_del(res_list, 0); | ||
403 | } | 402 | } |
404 | list_free(res_list); | 403 | list_free(res_list); |
405 | free(line); | 404 | free(line); |