From: William Lallemand Date: Tue, 15 May 2018 09:50:04 +0000 (+0200) Subject: BUG/MINOR: cli: don't stop cli_gen_usage_msg() when kw->usage == NULL X-Git-Tag: v1.9-dev1~263 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0154edc96f6bef1a78f53c45735805983b7b1828;p=thirdparty%2Fhaproxy.git BUG/MINOR: cli: don't stop cli_gen_usage_msg() when kw->usage == NULL In commit abbf607 ("MEDIUM: cli: Add payload support") some cli keywords without usage message have been added at the beginning of the keywords array. cli_gen_usage_usage_msg() use the kw->usage == NULL to stop generating the usage message for the current keywords array. With those keywords at the beginning, the whole array in cli.c was ignored in the usage message generation. This patch now checks the keyword itself, allowing a keyword without usage message anywhere in the array. --- diff --git a/src/cli.c b/src/cli.c index 38d715f838..4adf68401e 100644 --- a/src/cli.c +++ b/src/cli.c @@ -109,8 +109,9 @@ static char *cli_gen_usage_msg(struct appctx *appctx) chunk_strcat(tmp, stats_sock_usage_msg); list_for_each_entry(kw_list, &cli_keywords.list, list) { kw = &kw_list->kw[0]; - while (kw->usage) { - chunk_appendf(tmp, " %s\n", kw->usage); + while (kw->str_kw[0]) { + if (kw->usage) + chunk_appendf(tmp, " %s\n", kw->usage); kw++; } }