From 1158386bb813c262f3cb08675040694740783ff7 Mon Sep 17 00:00:00 2001 From: sskorgal Date: Fri, 1 Jul 2016 10:42:22 +0530 Subject: Fix for redis_cli printing default DB when select command fails. --- src/redis-cli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/redis-cli.c b/src/redis-cli.c index 17fb53394..070388380 100644 --- a/src/redis-cli.c +++ b/src/redis-cli.c @@ -916,7 +916,7 @@ static int cliSendCommand(int argc, char **argv, int repeat) { return REDIS_ERR; } else { /* Store database number when SELECT was successfully executed. */ - if (!strcasecmp(command,"select") && argc == 2) { + if (!strcasecmp(command,"select") && argc == 2 && config.last_cmd_type != REDIS_REPLY_ERROR) { config.dbnum = atoi(argv[1]); cliRefreshPrompt(); } else if (!strcasecmp(command,"auth") && argc == 2) { -- cgit v1.2.1