WITHSCORES in ZRANGEBYSCORE thanks to Sam Hendley

This commit is contained in:
antirez 2010-02-07 10:32:28 +01:00
parent 0500ef2736
commit 3a3978b10b

10
redis.c
View File

@ -5201,14 +5201,14 @@ static void zrangebyscoreCommand(redisClient *c) {
int badsyntax = 0; int badsyntax = 0;
if (c->argc == 5 || c->argc == 8) { if (c->argc == 5 || c->argc == 8) {
if (strcasecmp(c->argv[c->argc-1]->ptr,"withscores") == 0) withscores = 1; if (strcasecmp(c->argv[c->argc-1]->ptr,"withscores") == 0)
else badsyntax = 1; withscores = 1;
} else
if (c->argc != (4 + withscores) && c->argc != (7 + withscores)) {
badsyntax = 1; badsyntax = 1;
} }
if (c->argc != (4 + withscores) && c->argc != (7 + withscores))
badsyntax = 1;
if (badsyntax) { if (badsyntax) {
addReplySds(c, addReplySds(c,