From 588116af483416a1cd99526627760a44473e5d0c Mon Sep 17 00:00:00 2001 From: Giles Atkinson <“gatk555@gmail.com”> Date: Tue, 19 Sep 2023 18:29:10 +0100 Subject: [PATCH] Fix a bug in the "help" command. Some commands have no action function, so the function pointer should not be used to detect the end of the table. Use the command name instead. --- src/frontend/com_help.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/frontend/com_help.c b/src/frontend/com_help.c index 1039ec386..d8ffebe6a 100644 --- a/src/frontend/com_help.c +++ b/src/frontend/com_help.c @@ -81,7 +81,7 @@ void com_help(wordlist *wl) else { while (wl != NULL) { struct comm *c; - for (c = &cp_coms[0]; c->co_func != NULL; c++) + for (c = &cp_coms[0]; c->co_comname != NULL; c++) { if (eq(wl->wl_word, c->co_comname)) { out_printf("%s ", c->co_comname); out_printf(c->co_help, cp_program); @@ -90,7 +90,8 @@ void com_help(wordlist *wl) out_send("\n"); break; } - if (c->co_func == NULL) { + } + if (c->co_comname == NULL) { /* See if this is aliased. */ struct alias *al;