summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/cfg.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2019-12-19 09:22:34 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2019-12-19 09:22:34 +0000
commita3979efc302bbe96c95d420f358be38bd59b510c (patch)
treef5319daa28475face7b417aa321dda365e22e034 /usr.bin/tmux/cfg.c
parent5aa3aeb10e0552d44d3905bbbb46eb704d6c68c6 (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 'usr.bin/tmux/cfg.c')
-rw-r--r--usr.bin/tmux/cfg.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/tmux/cfg.c b/usr.bin/tmux/cfg.c
index 91d7d9443d5..9a105b49ed8 100644
--- a/usr.bin/tmux/cfg.c
+++ b/usr.bin/tmux/cfg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cfg.c,v 1.77 2019/12/12 12:49:36 nicm Exp $ */
+/* $OpenBSD: cfg.c,v 1.78 2019/12/19 09:22:33 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -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)