summaryrefslogtreecommitdiff
path: root/lib/command_match.c
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2016-10-04 20:56:30 +0000
committerQuentin Young <qlyoung@cumulusnetworks.com>2016-10-04 20:56:30 +0000
commitcc0a8be6336c8f074a7397d3810cc5efa037e5cb (patch)
treeaff0aa425b3f155f767b5927722635a966f1a38f /lib/command_match.c
parent42debbb43df2b9c54933a690f1a747c6899902a0 (diff)
lib: Allow / and . to match VARIABLE_TKN, fix range matches
Range matching function was returning 0 instead of no_match on failed match, causing all input to match ranges. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'lib/command_match.c')
-rw-r--r--lib/command_match.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/command_match.c b/lib/command_match.c
index 85d627e1be..dcad943619 100644
--- a/lib/command_match.c
+++ b/lib/command_match.c
@@ -758,7 +758,7 @@ match_range (struct cmd_token *token, const char *str)
val = strtoll (str, &endptr, 10);
if (*endptr != '\0')
- return 0;
+ return no_match;
if (val < token->min || val > token->max)
return no_match;
@@ -789,7 +789,7 @@ match_word (struct cmd_token *token, const char *word)
}
#define VARIABLE_ALPHABET \
-"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890:"
+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890:/."
static enum match_type
match_variable (struct cmd_token *token, const char *word)