From: Pierre-Alexandre Meyer Date: Sun, 22 Mar 2009 02:51:21 +0000 (-0700) Subject: hdt: Hide show/set help when no module is defined X-Git-Tag: syslinux-3.80-pre1~77 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9f91365effab9315033a84402374065d62d13e70;p=platform%2Fupstream%2Fsyslinux.git hdt: Hide show/set help when no module is defined Impact: Help output improved. Small improvement in the module help output: the module_descr structure can be defined but without any module. Add this sanity check. Signed-off-by: Pierre-Alexandre Meyer --- diff --git a/com32/hdt/hdt-cli-hdt.c b/com32/hdt/hdt-cli-hdt.c index fe2c11e..41bb30c 100644 --- a/com32/hdt/hdt-cli-hdt.c +++ b/com32/hdt/hdt-cli-hdt.c @@ -112,7 +112,8 @@ static void show_cli_help(int argc __unused, char** argv __unused, } /* List secondly the show modules of the mode */ - if (current_mode->show_modules != NULL ) { + if (current_mode->show_modules != NULL && + current_mode->show_modules->nb_modules != 0) { printf("show commands:\n"); for (j = 0; j < current_mode->show_modules->nb_modules; j++) { printf("\t%s\n", @@ -121,7 +122,8 @@ static void show_cli_help(int argc __unused, char** argv __unused, } /* List thirdly the set modules of the mode */ - if (current_mode->set_modules != NULL ) { + if (current_mode->set_modules != NULL && + current_mode->set_modules->nb_modules != 0) { printf("set commands:\n"); for (j = 0; j < current_mode->set_modules->nb_modules; j++) { printf("\t%s\n",