From aeab473dfbc6d5ad67cc7fb9775395eb31c64a44 Mon Sep 17 00:00:00 2001 From: antirez Date: Thu, 20 Jun 2013 15:34:56 +0200 Subject: [PATCH] Allow PUBSUB NUMSUB without channels. The result is an empty list but it is handy to call it programmatically. --- src/pubsub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pubsub.c b/src/pubsub.c index ab63ca7e..9fafbdcb 100644 --- a/src/pubsub.c +++ b/src/pubsub.c @@ -335,8 +335,8 @@ void pubsubCommand(redisClient *c) { } dictReleaseIterator(di); setDeferredMultiBulkLength(c,replylen,mblen); - } else if (!strcasecmp(c->argv[1]->ptr,"numsub") && c->argc > 2) { - /* PUBSUB NUMSUB Channel_1 [... Channel_N] */ + } else if (!strcasecmp(c->argv[1]->ptr,"numsub") && c->argc >= 2) { + /* PUBSUB NUMSUB [Channel_1 ... Channel_N] */ int j; addReplyMultiBulkLen(c,(c->argc-2)*2);