Preserve command group when moving temporary list to current list being

buit.
This commit is contained in:
nicm
2021-08-21 14:06:17 +00:00
parent 110ba767e5
commit c286fbdcd7
3 changed files with 14 additions and 2 deletions

13
cmd.c
View File

@ -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)
{