From 6e1045696741385fa028f93eef181aa1f9cb33c1 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Fri, 3 Apr 2009 12:15:18 +0000 Subject: search: use fnmatch so we have support for wildcards --- src/search.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/search.c b/src/search.c index dbbc2f4..208cff1 100644 --- a/src/search.c +++ b/src/search.c @@ -9,6 +9,7 @@ * by the Free Software Foundation. See http://www.gnu.org/ for details. */ +#include #include #include "apk_defines.h" #include "apk_applet.h" @@ -46,7 +47,7 @@ static int search_query_print(apk_hash_item item, void *ctx) struct search_query_ctx *ictx = (struct search_query_ctx *) ctx; struct apk_package *pkg = (struct apk_package *) item; - if( strstr(pkg->name->name, ictx->query) == NULL ) + if (fnmatch(ictx->query, pkg->name->name, 0) != 0) return 0; search_list_print(item, ictx->db); -- cgit v1.2.3-70-g09d2