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>
This commit is contained in:
Quentin Young 2016-10-04 20:56:30 +00:00
parent 42debbb43d
commit cc0a8be633

View file

@ -758,7 +758,7 @@ match_range (struct cmd_token *token, const char *str)
val = strtoll (str, &endptr, 10); val = strtoll (str, &endptr, 10);
if (*endptr != '\0') if (*endptr != '\0')
return 0; return no_match;
if (val < token->min || val > token->max) if (val < token->min || val > token->max)
return no_match; return no_match;
@ -789,7 +789,7 @@ match_word (struct cmd_token *token, const char *word)
} }
#define VARIABLE_ALPHABET \ #define VARIABLE_ALPHABET \
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890:" "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890:/."
static enum match_type static enum match_type
match_variable (struct cmd_token *token, const char *word) match_variable (struct cmd_token *token, const char *word)