summaryrefslogtreecommitdiff
path: root/lib/command_match.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/command_match.c')
-rw-r--r--lib/command_match.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/command_match.c b/lib/command_match.c
index c165305d78..a1ae3ac6b9 100644
--- a/lib/command_match.c
+++ b/lib/command_match.c
@@ -195,7 +195,7 @@ static enum matcher_rv command_match_r(struct graph_node *start, vector vline,
enum matcher_rv status = MATCHER_NO_MATCH;
// get the minimum match level that can count as a full match
- struct cmd_token *token = start->data;
+ struct cmd_token *copy, *token = start->data;
enum match_type minmatch = min_match_level(token->type);
/* check history/stack of tokens
@@ -326,8 +326,8 @@ static enum matcher_rv command_match_r(struct graph_node *start, vector vline,
}
if (*currbest) {
// copy token, set arg and prepend to currbest
- struct cmd_token *token = start->data;
- struct cmd_token *copy = cmd_token_dup(token);
+ token = start->data;
+ copy = cmd_token_dup(token);
copy->arg = XSTRDUP(MTYPE_CMD_ARG, input_token);
listnode_add_before(*currbest, (*currbest)->head, copy);
} else if (n + 1 == vector_active(vline) && status == MATCHER_NO_MATCH)