diff mbox

nconfig: add search support

Message ID 20100806140923.GA26456@merkur.ravnborg.org (mailing list archive)
State New, archived
Headers show

Commit Message

Sam Ravnborg Aug. 6, 2010, 2:09 p.m. UTC
None
diff mbox

Patch

diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
index e95718f..8cda9c0 100644
--- a/scripts/kconfig/symbol.c
+++ b/scripts/kconfig/symbol.c
@@ -842,6 +842,7 @@  struct symbol *sym_find(const char *name)
 
 struct symbol **sym_re_search(const char *pattern)
 {
+	struct property *prop;
 	struct symbol *sym, **sym_arr = NULL;
 	int i, cnt, size;
 	regex_t re;
@@ -854,9 +855,15 @@  struct symbol **sym_re_search(const char *pattern)
 		return NULL;
 
 	for_all_symbols(i, sym) {
+		bool found = false;
 		if (sym->flags & SYMBOL_CONST || !sym->name)
 			continue;
-		if (regexec(&re, sym->name, 0, NULL, 0))
+		if (!regexec(&re, sym->name, 0, NULL, 0))
+			found = true;
+		for_all_prompts(sym, prop)
+			if (!regexec(&re, prop->text, 0, NULL, 0))
+				found = true;
+		if (!found)
 			continue;
 		if (cnt + 1 >= size) {
 			void *tmp = sym_arr;