all these warnings...

Bernhard Reutner-Fischer rep.dot.nop at gmail.com
Mon May 2 07:47:43 UTC 2011


On Sat, Apr 30, 2011 at 10:49:52PM +0200, Harald Becker wrote:
> Hallo Denys!
>
>>                         /* print help */
>>                         if (line[1] == '\n') {
>>                                 help = nohelp_text;
>>                                 if (menu->sym->help)
>>                                         help = menu->sym->help;
>>                                 printf("\n%s\n", menu->sym->help);
>>                                 def = NULL;
>>                                 break;
>> Above, variable "help" is not used and can be deleted.
>
>Shouldn't this be ... ?
>
>printf( "\n%s\n", help );
>
>or may be better ... ?
>
>printf("\n%s\n", menu->sym->help ? menu->sym->help : nohelp_text );

What i always found inconvenient is the handling of helptext for e.g. choices;

--- config.OLD/mconf.c  2008-10-17 19:38:37.000000000 +0200
+++ config/mconf.c      2008-10-27 15:08:57.000000000 +0100
@@ -704,9 +704,12 @@
        {
                if (sym->name) {
                        str_printf(&help, "%s:\n\n", sym->name);
-                       str_append(&help, _(menu_get_help(menu)));
-                       str_append(&help, "\n");
                }
+               str_append(&help, _(menu_get_help(menu)));
+               str_append(&help, "\n");
+       } else if (menu_has_help(sym->prop->menu->parent)) {
+               str_append(&help, _(menu_get_help(sym->prop->menu->parent)));
+               str_append(&help, "\n");
        } else {
                str_append(&help, nohelp_text);
        }

just fyi..


More information about the busybox mailing list