From 2925bdc63bcf62acd8a536cc629f4a54d64b370c Mon Sep 17 00:00:00 2001 From: Angus Pearson Date: Wed, 2 Jan 2019 19:21:49 +0000 Subject: [PATCH] Add comment explaining negative repeat --- src/redis-cli.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/redis-cli.c b/src/redis-cli.c index d9145454..5ff0ad1d 100644 --- a/src/redis-cli.c +++ b/src/redis-cli.c @@ -1141,6 +1141,8 @@ static int cliSendCommand(int argc, char **argv, long repeat) { for (j = 0; j < argc; j++) argvlen[j] = sdslen(argv[j]); + /* Negative repeat is allowed and causes infinite loop, + works well with the interval option. */ while(repeat < 0 || repeat-- > 0) { redisAppendCommandArgv(context,argc,(const char**)argv,argvlen); while (config.monitor_mode) {