From: Arnaud Lacombe Date: Thu, 4 Aug 2011 01:52:07 +0000 (-0400) Subject: config: factor code in menu_get_ext_help() X-Git-Tag: 1.9.5~31 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=70cee40c5ea8e5f1ac7a9a426692f270abc75fe2;p=carl9170fw.git config: factor code in menu_get_ext_help() Cc: Srinivas Kandagatla Signed-off-by: Arnaud Lacombe Signed-off-by: Michal Marek Signed-off-by: Christian Lamparter --- diff --git a/config/menu.c b/config/menu.c index beeb92e..8c2a97e 100644 --- a/config/menu.c +++ b/config/menu.c @@ -10,8 +10,7 @@ #include "lkc.h" -static const char nohelp_text[] = N_( - "There is no help available for this option.\n"); +static const char nohelp_text[] = "There is no help available for this option."; struct menu rootmenu; static struct menu **last_entry_ptr; @@ -595,15 +594,14 @@ struct gstr get_relations_str(struct symbol **sym_arr) void menu_get_ext_help(struct menu *menu, struct gstr *help) { struct symbol *sym = menu->sym; + const char *help_text = nohelp_text; if (menu_has_help(menu)) { if (sym->name) str_printf(help, "%s%s:\n\n", CONFIG_, sym->name); - str_append(help, _(menu_get_help(menu))); - str_append(help, "\n"); - } else { - str_append(help, nohelp_text); + help_text = menu_get_help(menu); } + str_printf(help, "%s\n", _(help_text)); if (sym) get_symbol_str(help, sym); }