summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2017-08-25 14:08:16 -0400
committerQuentin Young <qlyoung@cumulusnetworks.com>2017-08-25 15:41:32 -0400
commit935cee3f9b84903b821c8abc17b70cbda08cb145 (patch)
tree6e3494b1c802eea4aea99351af5ca26de1151988
parent8295b504cbd6df715b779287ff9d2374ae306421 (diff)
lib: remove static variable from cli matcher
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
-rw-r--r--lib/command_match.c13
1 files changed, 5 insertions, 8 deletions
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;
}
/**