From patchwork Fri Aug 6 14:09:23 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 117813 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o76E9QFi001722 for ; Fri, 6 Aug 2010 14:09:26 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757333Ab0HFOJ0 (ORCPT ); Fri, 6 Aug 2010 10:09:26 -0400 Received: from pfepb.post.tele.dk ([195.41.46.236]:49450 "EHLO pfepb.post.tele.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756861Ab0HFOJZ (ORCPT ); Fri, 6 Aug 2010 10:09:25 -0400 Received: from merkur.ravnborg.org (x1-6-00-1e-2a-84-ae-3e.k225.webspeed.dk [80.163.61.94]) by pfepb.post.tele.dk (Postfix) with ESMTP id 12654F84025; Fri, 6 Aug 2010 16:09:23 +0200 (CEST) Date: Fri, 6 Aug 2010 16:09:23 +0200 From: Sam Ravnborg To: Randy Dunlap Cc: nir.tzachar@gmail.com, mmarek@suse.cz, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] nconfig: add search support Message-ID: <20100806140923.GA26456@merkur.ravnborg.org> References: <1280838492-9942-1-git-send-email-nir.tzachar@gmail.com> <20100805100408.5b724047.randy.dunlap@oracle.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20100805100408.5b724047.randy.dunlap@oracle.com> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 06 Aug 2010 14:09:27 +0000 (UTC) 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;