mirror of https://mirror.osredm.com/root/redis.git
Allow decimals, exponent numbers in expressions.
This commit is contained in:
parent
d3ada8090f
commit
ef24ab7821
6
expr.c
6
expr.c
|
@ -246,8 +246,10 @@ void exprParseNumber(exprstate *es) {
|
|||
es->current.token_type = EXPR_TOKEN_NUM;
|
||||
char num[64];
|
||||
int idx = 0;
|
||||
while(isdigit(es->p[0]) || (idx == 0 && es->p[0] == '-')) {
|
||||
if (idx >= sizeof(num)-1) {
|
||||
while(isdigit(es->p[0]) || es->p[0] == '.' || es->p[0] == 'e' ||
|
||||
es->p[0] == 'E' || (idx == 0 && es->p[0] == '-'))
|
||||
{
|
||||
if (idx >= (int)sizeof(num)-1) {
|
||||
es->syntax_error++; // Number is too long.
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue