summaryrefslogtreecommitdiffstats
path: root/cfg.c
diff options
context:
space:
mode:
authornicm <nicm>2019-12-19 09:22:33 +0000
committernicm <nicm>2019-12-19 09:22:33 +0000
commit1764f66b7d1ed0e494cfa8967c78ace8728ee86c (patch)
tree84e6483ab9ec00b4f22e61d764b866562ac6e0d8 /cfg.c
parentef54a08080ef7d721d05361bf10e27217c87590e (diff)
When adding a list with multiple commands to the queue, the next item to
insert after needs to be the last one added, not the first. Reported by Jason Kim in GitHub issue 2023.
Diffstat (limited to 'cfg.c')
-rw-r--r--cfg.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/cfg.c b/cfg.c
index 8509ad1b..92c87225 100644
--- a/cfg.c
+++ b/cfg.c
@@ -185,9 +185,9 @@ load_cfg(const char *path, struct client *c, struct cmdq_item *item, int flags,
new_item0 = cmdq_get_command(pr->cmdlist, NULL, NULL, 0);
if (item != NULL)
- cmdq_insert_after(item, new_item0);
+ new_item0 = cmdq_insert_after(item, new_item0);
else
- cmdq_append(NULL, new_item0);
+ new_item0 = cmdq_append(NULL, new_item0);
cmd_list_free(pr->cmdlist);
if (new_item != NULL)
@@ -231,9 +231,9 @@ load_cfg_from_buffer(const void *buf, size_t len, const char *path,
new_item0 = cmdq_get_command(pr->cmdlist, NULL, NULL, 0);
if (item != NULL)
- cmdq_insert_after(item, new_item0);
+ new_item0 = cmdq_insert_after(item, new_item0);
else
- cmdq_append(NULL, new_item0);
+ new_item0 = cmdq_append(NULL, new_item0);
cmd_list_free(pr->cmdlist);
if (new_item != NULL)