Commit 6e104569 authored by Natanael Copa's avatar Natanael Copa

search: use fnmatch so we have support for wildcards

parent 8d44e8ed
......@@ -9,6 +9,7 @@
* by the Free Software Foundation. See http://www.gnu.org/ for details.
*/
#include <fnmatch.h>
#include <stdio.h>
#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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment