From b37ca6edb10faa0ebcf54a7d23cee31d895fe5b1 Mon Sep 17 00:00:00 2001 From: antirez Date: Tue, 24 Aug 2010 18:08:09 +0200 Subject: [PATCH] Issue 179 fixed, now redis-cli is able to parse correctly multi bulk replies with elements that are errors --- src/redis-cli.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/redis-cli.c b/src/redis-cli.c index b4a10890..007ebcde 100644 --- a/src/redis-cli.c +++ b/src/redis-cli.c @@ -169,6 +169,7 @@ static int cliReadBulkReply(int fd) { static int cliReadMultiBulkReply(int fd) { sds replylen = cliReadLine(fd); int elements, c = 1; + int retval = 0; if (replylen == NULL) return 1; elements = atoi(replylen); @@ -182,10 +183,10 @@ static int cliReadMultiBulkReply(int fd) { } while(elements--) { printf("%d. ", c); - if (cliReadReply(fd)) return 1; + if (cliReadReply(fd)) retval = 1; c++; } - return 0; + return retval; } static int cliReadReply(int fd) { -- 2.45.2