kconfig: remove CONFIG_ from string constants

Having the CONFIG_ prefix in string constants gets in the way of
using a run-time-defined CONFIG_ prefix.

Fix that by using temp growable strings (gstr) in which we printf
the text.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Michal Marek <mmarek@suse.cz>
This commit is contained in:
Yann E. MORIN 2012-10-20 01:06:23 +02:00 committed by Michal Marek
parent 7d5bb96629
commit 337a275d03
2 changed files with 17 additions and 4 deletions

View File

@ -348,15 +348,19 @@ static void search_conf(void)
{ {
struct symbol **sym_arr; struct symbol **sym_arr;
struct gstr res; struct gstr res;
struct gstr title;
char *dialog_input; char *dialog_input;
int dres, vscroll = 0, hscroll = 0; int dres, vscroll = 0, hscroll = 0;
bool again; bool again;
title = str_new();
str_printf( &title, _("Enter %s (sub)string to search for "
"(with or without \"%s\")"), CONFIG_, CONFIG_);
again: again:
dialog_clear(); dialog_clear();
dres = dialog_inputbox(_("Search Configuration Parameter"), dres = dialog_inputbox(_("Search Configuration Parameter"),
_("Enter " CONFIG_ " (sub)string to search for " str_get(&title),
"(with or without \"" CONFIG_ "\")"),
10, 75, ""); 10, 75, "");
switch (dres) { switch (dres) {
case 0: case 0:
@ -365,6 +369,7 @@ again:
show_helptext(_("Search Configuration"), search_help); show_helptext(_("Search Configuration"), search_help);
goto again; goto again;
default: default:
str_free(&title);
return; return;
} }
@ -398,6 +403,7 @@ again:
str_free(&res); str_free(&res);
} while (again); } while (again);
free(sym_arr); free(sym_arr);
str_free(&title);
} }
static void build_conf(struct menu *menu) static void build_conf(struct menu *menu)

View File

@ -696,13 +696,18 @@ static void search_conf(void)
{ {
struct symbol **sym_arr; struct symbol **sym_arr;
struct gstr res; struct gstr res;
struct gstr title;
char *dialog_input; char *dialog_input;
int dres; int dres;
title = str_new();
str_printf( &title, _("Enter %s (sub)string to search for "
"(with or without \"%s\")"), CONFIG_, CONFIG_);
again: again:
dres = dialog_inputbox(main_window, dres = dialog_inputbox(main_window,
_("Search Configuration Parameter"), _("Search Configuration Parameter"),
_("Enter " CONFIG_ " (sub)string to search for " str_get(&title),
"(with or without \"" CONFIG_ "\")"),
"", &dialog_input_result, &dialog_input_result_len); "", &dialog_input_result, &dialog_input_result_len);
switch (dres) { switch (dres) {
case 0: case 0:
@ -712,6 +717,7 @@ again:
_("Search Configuration"), search_help); _("Search Configuration"), search_help);
goto again; goto again;
default: default:
str_free(&title);
return; return;
} }
@ -726,6 +732,7 @@ again:
show_scroll_win(main_window, show_scroll_win(main_window,
_("Search Results"), str_get(&res)); _("Search Results"), str_get(&res));
str_free(&res); str_free(&res);
str_free(&title);
} }