diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2021-08-21 14:06:18 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2021-08-21 14:06:18 +0000 |
commit | dda215a0af137eeca5fd3902fb22f4886b5c9377 (patch) | |
tree | 78e7757ca7d3a743fd934e49b298b0852c1a57dd /usr.bin/tmux/cmd.c | |
parent | b4a0cc641b4a5e66c24b34e0d97ad8ca533bfad2 (diff) |
Preserve command group when moving temporary list to current list being
buit.
Diffstat (limited to 'usr.bin/tmux/cmd.c')
-rw-r--r-- | usr.bin/tmux/cmd.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/usr.bin/tmux/cmd.c b/usr.bin/tmux/cmd.c index c255c162386..ed05e466427 100644 --- a/usr.bin/tmux/cmd.c +++ b/usr.bin/tmux/cmd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd.c,v 1.167 2021/08/21 08:44:59 nicm Exp $ */ +/* $OpenBSD: cmd.c,v 1.168 2021/08/21 14:06:17 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -594,7 +594,18 @@ cmd_list_append(struct cmd_list *cmdlist, struct cmd *cmd) TAILQ_INSERT_TAIL(cmdlist->list, cmd, qentry); } -/* Move all commands from one command list to another */ +/* Append all commands from one list to another. */ +void +cmd_list_append_all(struct cmd_list *cmdlist, struct cmd_list *from) +{ + struct cmd *cmd; + + TAILQ_FOREACH(cmd, from->list, qentry) + cmd->group = cmdlist->group; + TAILQ_CONCAT(cmdlist->list, from->list, qentry); +} + +/* Move all commands from one command list to another. */ void cmd_list_move(struct cmd_list *cmdlist, struct cmd_list *from) { |