diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/XpathParser.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/XpathParser.c b/src/XpathParser.c index b79fe11..b69e47d 100644 --- a/src/XpathParser.c +++ b/src/XpathParser.c @@ -36,19 +36,25 @@ static int xpath_parse_param(QuickMediaXpathParser *self, QuickMediaNodeSearchPa return -3; result->value = self->tokenizer.string; + + token = quickmedia_xpath_tokenizer_next(&self->tokenizer); + if(token != QUICKMEDIA_XPATH_TOKEN_CLOSING_BRACKET) + return -4; + + result->defined = 1; + result->value_is_glob = contains_glob_char(result->value); + return 0; } else if(token == QUICKMEDIA_XPATH_TOKEN_NUMBER) { result->index = self->tokenizer.number; + + token = quickmedia_xpath_tokenizer_next(&self->tokenizer); + if(token != QUICKMEDIA_XPATH_TOKEN_CLOSING_BRACKET) + return -4; + + return 0; } else { return -1; } - - token = quickmedia_xpath_tokenizer_next(&self->tokenizer); - if(token != QUICKMEDIA_XPATH_TOKEN_CLOSING_BRACKET) - return -4; - - result->defined = 1; - result->value_is_glob = contains_glob_char(result->value); - return 0; } /* ('[' NUMBER ']'))? */ |