diff options
| author | Yann E. MORIN <yann.morin.1998@free.fr> | 2012-10-19 19:06:23 -0400 |
|---|---|---|
| committer | Michal Marek <mmarek@suse.cz> | 2012-11-20 05:20:08 -0500 |
| commit | 337a275d03e0b900dc8ac3ab5583d18099fedae6 (patch) | |
| tree | 0301b425b541ee91dcffdb5253536a448efd15e9 /scripts | |
| parent | 7d5bb966290d71d9dfe69a3ed0c31b26bf9afc63 (diff) | |
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>
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/kconfig/mconf.c | 10 | ||||
| -rw-r--r-- | scripts/kconfig/nconf.c | 11 |
2 files changed, 17 insertions, 4 deletions
diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c index 48f67448af7b..5f29618d1845 100644 --- a/scripts/kconfig/mconf.c +++ b/scripts/kconfig/mconf.c | |||
| @@ -348,15 +348,19 @@ static void search_conf(void) | |||
| 348 | { | 348 | { |
| 349 | struct symbol **sym_arr; | 349 | struct symbol **sym_arr; |
| 350 | struct gstr res; | 350 | struct gstr res; |
| 351 | struct gstr title; | ||
| 351 | char *dialog_input; | 352 | char *dialog_input; |
| 352 | int dres, vscroll = 0, hscroll = 0; | 353 | int dres, vscroll = 0, hscroll = 0; |
| 353 | bool again; | 354 | bool again; |
| 354 | 355 | ||
| 356 | title = str_new(); | ||
| 357 | str_printf( &title, _("Enter %s (sub)string to search for " | ||
| 358 | "(with or without \"%s\")"), CONFIG_, CONFIG_); | ||
| 359 | |||
| 355 | again: | 360 | again: |
| 356 | dialog_clear(); | 361 | dialog_clear(); |
| 357 | dres = dialog_inputbox(_("Search Configuration Parameter"), | 362 | dres = dialog_inputbox(_("Search Configuration Parameter"), |
| 358 | _("Enter " CONFIG_ " (sub)string to search for " | 363 | str_get(&title), |
| 359 | "(with or without \"" CONFIG_ "\")"), | ||
| 360 | 10, 75, ""); | 364 | 10, 75, ""); |
| 361 | switch (dres) { | 365 | switch (dres) { |
| 362 | case 0: | 366 | case 0: |
| @@ -365,6 +369,7 @@ again: | |||
| 365 | show_helptext(_("Search Configuration"), search_help); | 369 | show_helptext(_("Search Configuration"), search_help); |
| 366 | goto again; | 370 | goto again; |
| 367 | default: | 371 | default: |
| 372 | str_free(&title); | ||
| 368 | return; | 373 | return; |
| 369 | } | 374 | } |
| 370 | 375 | ||
| @@ -398,6 +403,7 @@ again: | |||
| 398 | str_free(&res); | 403 | str_free(&res); |
| 399 | } while (again); | 404 | } while (again); |
| 400 | free(sym_arr); | 405 | free(sym_arr); |
| 406 | str_free(&title); | ||
| 401 | } | 407 | } |
| 402 | 408 | ||
| 403 | static void build_conf(struct menu *menu) | 409 | static void build_conf(struct menu *menu) |
diff --git a/scripts/kconfig/nconf.c b/scripts/kconfig/nconf.c index 87d4b15da951..261f926d8f4b 100644 --- a/scripts/kconfig/nconf.c +++ b/scripts/kconfig/nconf.c | |||
| @@ -696,13 +696,18 @@ static void search_conf(void) | |||
| 696 | { | 696 | { |
| 697 | struct symbol **sym_arr; | 697 | struct symbol **sym_arr; |
| 698 | struct gstr res; | 698 | struct gstr res; |
| 699 | struct gstr title; | ||
| 699 | char *dialog_input; | 700 | char *dialog_input; |
| 700 | int dres; | 701 | int dres; |
| 702 | |||
| 703 | title = str_new(); | ||
| 704 | str_printf( &title, _("Enter %s (sub)string to search for " | ||
| 705 | "(with or without \"%s\")"), CONFIG_, CONFIG_); | ||
| 706 | |||
| 701 | again: | 707 | again: |
| 702 | dres = dialog_inputbox(main_window, | 708 | dres = dialog_inputbox(main_window, |
| 703 | _("Search Configuration Parameter"), | 709 | _("Search Configuration Parameter"), |
| 704 | _("Enter " CONFIG_ " (sub)string to search for " | 710 | str_get(&title), |
| 705 | "(with or without \"" CONFIG_ "\")"), | ||
| 706 | "", &dialog_input_result, &dialog_input_result_len); | 711 | "", &dialog_input_result, &dialog_input_result_len); |
| 707 | switch (dres) { | 712 | switch (dres) { |
| 708 | case 0: | 713 | case 0: |
| @@ -712,6 +717,7 @@ again: | |||
| 712 | _("Search Configuration"), search_help); | 717 | _("Search Configuration"), search_help); |
| 713 | goto again; | 718 | goto again; |
| 714 | default: | 719 | default: |
| 720 | str_free(&title); | ||
| 715 | return; | 721 | return; |
| 716 | } | 722 | } |
| 717 | 723 | ||
| @@ -726,6 +732,7 @@ again: | |||
| 726 | show_scroll_win(main_window, | 732 | show_scroll_win(main_window, |
| 727 | _("Search Results"), str_get(&res)); | 733 | _("Search Results"), str_get(&res)); |
| 728 | str_free(&res); | 734 | str_free(&res); |
| 735 | str_free(&title); | ||
| 729 | } | 736 | } |
| 730 | 737 | ||
| 731 | 738 | ||
