From 9b438946c995c80afb47c4cef6b03ae845098698 Mon Sep 17 00:00:00 2001 From: Andrew Gabbasov Date: Fri, 27 Dec 2013 10:05:14 -0600 Subject: [PATCH] command.c: Fix auto-completion for the full commands list case Compiling of full list of commands does not advance the counter, so it always results in an empty list. This seems to be (inadvertently?) introduced by commit 6c7c946cadfafdea80eb930e3181085b907a0362. Signed-off-by: Andrew Gabbasov --- common/command.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/command.c b/common/command.c index 625571dd4d..597ab4cb4d 100644 --- a/common/command.c +++ b/common/command.c @@ -184,10 +184,10 @@ static int complete_cmdv(int argc, char * const argv[], char last_char, int maxv /* output full list of commands */ for (; cmdtp != cmdend; cmdtp++) { if (n_found >= maxv - 2) { - cmdv[n_found] = "..."; + cmdv[n_found++] = "..."; break; } - cmdv[n_found] = cmdtp->name; + cmdv[n_found++] = cmdtp->name; } cmdv[n_found] = NULL; return n_found; -- 2.30.2