From eed6e1d88d2b83550342933a6cb6900c4b6f2957 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Wed, 7 Sep 2016 15:36:48 +0200 Subject: [PATCH] add_command has an unused argument --- src/kernel/command.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/kernel/command.c b/src/kernel/command.c index 317d3fc2a..180c9068c 100644 --- a/src/kernel/command.c +++ b/src/kernel/command.c @@ -30,7 +30,6 @@ typedef struct command { parser fun; - struct tnode *nodes; } command; void *stree_find(const syntaxtree * stree, const struct locale *lang) @@ -69,14 +68,13 @@ syntaxtree *stree_create(void) void add_command(struct tnode **keys, void *tnext, -const char *str, parser fun) + const char *str, parser fun) { command *cmd = (command *)malloc(sizeof(command)); variant var; assert(str); cmd->fun = fun; - cmd->nodes = tnext; var.v = cmd; addtoken(keys, str, var); } @@ -90,12 +88,8 @@ static int do_command_i(const struct tnode *keys, struct unit *u, struct order * c = gettoken(token, sizeof(token)); if (findtoken(keys, c, &var) == E_TOK_SUCCESS) { command *cmd = (command *)var.v; - if (cmd->nodes && *c) { - assert(!cmd->fun); - return do_command_i(cmd->nodes, u, ord); - } - else if (cmd->fun) { - cmd->fun(cmd->nodes, u, ord); + if (cmd->fun) { + cmd->fun(0, u, ord); return E_TOK_SUCCESS; } }