From: Quentin Young Date: Fri, 25 Aug 2017 18:08:16 +0000 (-0400) Subject: lib: remove static variable from cli matcher X-Git-Tag: frr-4.0-dev~371^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=935cee3f9b84903b821c8abc17b70cbda08cb145;p=matthieu%2Ffrr.git lib: remove static variable from cli matcher Signed-off-by: Quentin Young --- diff --git a/lib/command_match.c b/lib/command_match.c index 5590fce6b1..ad3ec2492e 100644 --- a/lib/command_match.c +++ b/lib/command_match.c @@ -81,9 +81,6 @@ static enum match_type match_variable(struct cmd_token *, const char *); static enum match_type match_mac(const char *, bool); -/* matching functions */ -static enum matcher_rv matcher_rv; - enum matcher_rv command_match(struct graph *cmdgraph, vector vline, struct list **argv, const struct cmd_element **el) { @@ -446,12 +443,12 @@ enum matcher_rv command_complete(struct graph *graph, vector vline, * next = set of all nodes reachable from all nodes in `matched` */ - matcher_rv = idx == vector_active(vline) && next->count - ? MATCHER_OK - : MATCHER_NO_MATCH; + enum matcher_rv mrv = idx == vector_active(vline) && next->count + ? MATCHER_OK + : MATCHER_NO_MATCH; *completions = NULL; - if (!MATCHER_ERROR(matcher_rv)) { + if (!MATCHER_ERROR(mrv)) { // extract cmd_token into list *completions = list_new(); for (ALL_LIST_ELEMENTS_RO(next, node, gstack)) { @@ -462,7 +459,7 @@ enum matcher_rv command_complete(struct graph *graph, vector vline, list_delete(current); list_delete(next); - return matcher_rv; + return mrv; } /**