From d71c49610b8f05ce2bf0993acfa5bcf5a8893263 Mon Sep 17 00:00:00 2001 From: "dejun.xdj" Date: Wed, 16 May 2018 16:18:00 +0800 Subject: [PATCH] Stop saving auth command in redis-cli history. --- src/redis-cli.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/redis-cli.c b/src/redis-cli.c index ff1cd5a94..24e283e57 100644 --- a/src/redis-cli.c +++ b/src/redis-cli.c @@ -1399,8 +1399,10 @@ static void repl(void) { while((line = linenoise(context ? config.prompt : "not connected> ")) != NULL) { if (line[0] != '\0') { argv = cliSplitArgs(line,&argc); - if (history) linenoiseHistoryAdd(line); - if (historyfile) linenoiseHistorySave(historyfile); + if (strcasecmp(argv[0], "auth")) { + if (history) linenoiseHistoryAdd(line); + if (historyfile) linenoiseHistorySave(historyfile); + } if (argv == NULL) { printf("Invalid argument(s)\n");