mirror of https://gitee.com/openkylin/linux.git
kconfig: strip 'CONFIG_' automatically in kernel configuration search
Modify the ncurses configuration tool ('make menuconfig') in a way that the user can enter the search string (/) both with or without the leading 'CONFIG_'. This simplifies using copy & paste from .config files because you can select the whole word. Signed-off-by: Bernhard Walle <bwalle@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
This commit is contained in:
parent
c05190371d
commit
0584f9f9cb
|
@ -419,11 +419,13 @@ static void search_conf(void)
|
||||||
{
|
{
|
||||||
struct symbol **sym_arr;
|
struct symbol **sym_arr;
|
||||||
struct gstr res;
|
struct gstr res;
|
||||||
|
char *dialog_input;
|
||||||
int dres;
|
int dres;
|
||||||
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 (omit CONFIG_)"),
|
_("Enter CONFIG_ (sub)string to search for "
|
||||||
|
"(with or without \"CONFIG\")"),
|
||||||
10, 75, "");
|
10, 75, "");
|
||||||
switch (dres) {
|
switch (dres) {
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -435,7 +437,12 @@ static void search_conf(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
sym_arr = sym_re_search(dialog_input_result);
|
/* strip CONFIG_ if necessary */
|
||||||
|
dialog_input = dialog_input_result;
|
||||||
|
if (strncasecmp(dialog_input_result, "CONFIG_", 7) == 0)
|
||||||
|
dialog_input += 7;
|
||||||
|
|
||||||
|
sym_arr = sym_re_search(dialog_input);
|
||||||
res = get_relations_str(sym_arr);
|
res = get_relations_str(sym_arr);
|
||||||
free(sym_arr);
|
free(sym_arr);
|
||||||
show_textbox(_("Search Results"), str_get(&res), 0, 0);
|
show_textbox(_("Search Results"), str_get(&res), 0, 0);
|
||||||
|
|
Loading…
Reference in New Issue