summaryrefslogtreecommitdiff
path: root/src/redis-cli.c
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2016-07-05 15:18:40 +0200
committerantirez <antirez@gmail.com>2016-07-05 15:18:40 +0200
commitef6a4df29c17e3c79a1e9b328fe3e2d1f2a9df39 (patch)
treef8adc7225a2b032632a69ccc6a42bd80e67b7961 /src/redis-cli.c
parent0df286596d538fc9a22ca5dc2ec835205c055c26 (diff)
downloadredis-ef6a4df29c17e3c79a1e9b328fe3e2d1f2a9df39.tar.gz
redis-cli: check SELECT reply type just in state updated.
In issues #3361 / #3365 a problem was reported / fixed with redis-cli not updating correctly the current DB on error after SELECT. In theory this bug was fixed in 0042fb0e, but actually the commit only fixed the prompt updating, not the fact the state was set in a wrong way. This commit removes the check in the prompt update, now that hopefully it is the state that is correct, there is no longer need for this check.
Diffstat (limited to 'src/redis-cli.c')
-rw-r--r--src/redis-cli.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/redis-cli.c b/src/redis-cli.c
index 070388380..6aacecc77 100644
--- a/src/redis-cli.c
+++ b/src/redis-cli.c
@@ -161,7 +161,7 @@ static void cliRefreshPrompt(void) {
len = anetFormatAddr(config.prompt, sizeof(config.prompt),
config.hostip, config.hostport);
/* Add [dbnum] if needed */
- if (config.dbnum != 0 && config.last_cmd_type != REDIS_REPLY_ERROR)
+ if (config.dbnum != 0)
len += snprintf(config.prompt+len,sizeof(config.prompt)-len,"[%d]",
config.dbnum);
snprintf(config.prompt+len,sizeof(config.prompt)-len,"> ");