summaryrefslogtreecommitdiffstats
path: root/cmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'cmd.c')
-rw-r--r--cmd.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/cmd.c b/cmd.c
index d0a8c267..b7b144b4 100644
--- a/cmd.c
+++ b/cmd.c
@@ -392,6 +392,13 @@ cmd_get_args(struct cmd *cmd)
return (cmd->args);
}
+/* Get group for command. */
+u_int
+cmd_get_group(struct cmd *cmd)
+{
+ return (cmd->group);
+}
+
/* Get file and line for command. */
void
cmd_get_source(struct cmd *cmd, const char **file, u_int *line)
@@ -646,24 +653,16 @@ cmd_list_print(struct cmd_list *cmdlist, int escaped)
/* Get first command in list. */
struct cmd *
-cmd_list_first(struct cmd_list *cmdlist, u_int *group)
+cmd_list_first(struct cmd_list *cmdlist)
{
- struct cmd *cmd;
-
- cmd = TAILQ_FIRST(cmdlist->list);
- if (cmd != NULL && group != NULL)
- *group = cmd->group;
- return (cmd);
+ return (TAILQ_FIRST(cmdlist->list));
}
/* Get next command in list. */
struct cmd *
-cmd_list_next(struct cmd *cmd, u_int *group)
+cmd_list_next(struct cmd *cmd)
{
- cmd = TAILQ_NEXT(cmd, qentry);
- if (cmd != NULL && group != NULL)
- *group = cmd->group;
- return (cmd);
+ return (TAILQ_NEXT(cmd, qentry));
}
/* Do all of the commands in this command list have this flag? */