mirror of
https://github.com/tmux/tmux.git
synced 2025-01-07 08:18:48 +00:00
Merge branch 'obsd-master' into master
This commit is contained in:
commit
4d3367e965
@ -871,7 +871,7 @@ cmd_parse_build_commands(struct cmd_parse_commands *cmds,
|
|||||||
cmd_list_free(current);
|
cmd_list_free(current);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
cmd_list_move(current, add);
|
cmd_list_append_all(current, add);
|
||||||
cmd_list_free(add);
|
cmd_list_free(add);
|
||||||
}
|
}
|
||||||
if (current != NULL) {
|
if (current != NULL) {
|
||||||
|
24
cmd.c
24
cmd.c
@ -221,10 +221,6 @@ struct cmd {
|
|||||||
char *file;
|
char *file;
|
||||||
u_int line;
|
u_int line;
|
||||||
|
|
||||||
char *alias;
|
|
||||||
int argc;
|
|
||||||
char **argv;
|
|
||||||
|
|
||||||
TAILQ_ENTRY(cmd) qentry;
|
TAILQ_ENTRY(cmd) qentry;
|
||||||
};
|
};
|
||||||
TAILQ_HEAD(cmds, cmd);
|
TAILQ_HEAD(cmds, cmd);
|
||||||
@ -529,10 +525,6 @@ cmd_parse(int argc, char **argv, const char *file, u_int line, char **cause)
|
|||||||
cmd->file = xstrdup(file);
|
cmd->file = xstrdup(file);
|
||||||
cmd->line = line;
|
cmd->line = line;
|
||||||
|
|
||||||
cmd->alias = NULL;
|
|
||||||
cmd->argc = argc;
|
|
||||||
cmd->argv = cmd_copy_argv(argc, argv);
|
|
||||||
|
|
||||||
return (cmd);
|
return (cmd);
|
||||||
|
|
||||||
usage:
|
usage:
|
||||||
@ -546,9 +538,6 @@ usage:
|
|||||||
void
|
void
|
||||||
cmd_free(struct cmd *cmd)
|
cmd_free(struct cmd *cmd)
|
||||||
{
|
{
|
||||||
free(cmd->alias);
|
|
||||||
cmd_free_argv(cmd->argc, cmd->argv);
|
|
||||||
|
|
||||||
free(cmd->file);
|
free(cmd->file);
|
||||||
|
|
||||||
args_free(cmd->args);
|
args_free(cmd->args);
|
||||||
@ -593,7 +582,18 @@ cmd_list_append(struct cmd_list *cmdlist, struct cmd *cmd)
|
|||||||
TAILQ_INSERT_TAIL(cmdlist->list, cmd, qentry);
|
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
|
void
|
||||||
cmd_list_move(struct cmd_list *cmdlist, struct cmd_list *from)
|
cmd_list_move(struct cmd_list *cmdlist, struct cmd_list *from)
|
||||||
{
|
{
|
||||||
|
1
tmux.h
1
tmux.h
@ -2257,6 +2257,7 @@ void cmd_free(struct cmd *);
|
|||||||
char *cmd_print(struct cmd *);
|
char *cmd_print(struct cmd *);
|
||||||
struct cmd_list *cmd_list_new(void);
|
struct cmd_list *cmd_list_new(void);
|
||||||
void cmd_list_append(struct cmd_list *, struct cmd *);
|
void cmd_list_append(struct cmd_list *, struct cmd *);
|
||||||
|
void cmd_list_append_all(struct cmd_list *, struct cmd_list *);
|
||||||
void cmd_list_move(struct cmd_list *, struct cmd_list *);
|
void cmd_list_move(struct cmd_list *, struct cmd_list *);
|
||||||
void cmd_list_free(struct cmd_list *);
|
void cmd_list_free(struct cmd_list *);
|
||||||
char *cmd_list_print(struct cmd_list *, int);
|
char *cmd_list_print(struct cmd_list *, int);
|
||||||
|
Loading…
Reference in New Issue
Block a user