aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/kconfig/conf.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index 3baaaecd6b13..5de3303e65f5 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -38,14 +38,14 @@ static int conf_cnt;
38static char line[128]; 38static char line[128];
39static struct menu *rootEntry; 39static struct menu *rootEntry;
40 40
41static char nohelp_text[] = N_("Sorry, no help available for this option yet.\n"); 41static void print_help(struct menu *menu)
42
43static const char *get_help(struct menu *menu)
44{ 42{
45 if (menu_has_help(menu)) 43 struct gstr help = str_new();
46 return _(menu_get_help(menu)); 44
47 else 45 menu_get_ext_help(menu, &help);
48 return nohelp_text; 46
47 printf("\n%s\n", str_get(&help));
48 str_free(&help);
49} 49}
50 50
51static void strip(char *str) 51static void strip(char *str)
@@ -140,7 +140,7 @@ int conf_string(struct menu *menu)
140 case '?': 140 case '?':
141 /* print help */ 141 /* print help */
142 if (line[1] == '\n') { 142 if (line[1] == '\n') {
143 printf("\n%s\n", get_help(menu)); 143 print_help(menu);
144 def = NULL; 144 def = NULL;
145 break; 145 break;
146 } 146 }
@@ -220,7 +220,7 @@ static int conf_sym(struct menu *menu)
220 if (sym_set_tristate_value(sym, newval)) 220 if (sym_set_tristate_value(sym, newval))
221 return 0; 221 return 0;
222help: 222help:
223 printf("\n%s\n", get_help(menu)); 223 print_help(menu);
224 } 224 }
225} 225}
226 226
@@ -307,7 +307,7 @@ static int conf_choice(struct menu *menu)
307 fgets(line, 128, stdin); 307 fgets(line, 128, stdin);
308 strip(line); 308 strip(line);
309 if (line[0] == '?') { 309 if (line[0] == '?') {
310 printf("\n%s\n", get_help(menu)); 310 print_help(menu);
311 continue; 311 continue;
312 } 312 }
313 if (!line[0]) 313 if (!line[0])
@@ -331,7 +331,7 @@ static int conf_choice(struct menu *menu)
331 if (!child) 331 if (!child)
332 continue; 332 continue;
333 if (line[strlen(line) - 1] == '?') { 333 if (line[strlen(line) - 1] == '?') {
334 printf("\n%s\n", get_help(child)); 334 print_help(child);
335 continue; 335 continue;
336 } 336 }
337 sym_set_choice_value(sym, child->sym); 337 sym_set_choice_value(sym, child->sym);