From c0a47ea63cde5736412c46e289a692f8ced3bc4c 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 307825679..add9a4c5f 100644 --- a/src/pubsub.c +++ b/src/pubsub.c @@ -336,8 +336,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);