From 341e8a10ae58810fce2fd3bef4389a1df5147225 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Fri, 20 Feb 2015 11:01:18 +0100 Subject: [PATCH] xbps-query/search: minor optimizations. --- bin/xbps-query/search.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bin/xbps-query/search.c b/bin/xbps-query/search.c index de866a49..7d9ec107 100644 --- a/bin/xbps-query/search.c +++ b/bin/xbps-query/search.c @@ -129,9 +129,9 @@ search_array_cb(struct xbps_handle *xhp _unused, xbps_array_add_cstring_nocopy(sd->results, pkgver); xbps_array_add_cstring_nocopy(sd->results, desc); } else { - if ((xbps_pkgpattern_match(pkgver, sd->pat)) || - (strcasestr(pkgver, sd->pat)) || + if ((strcasestr(pkgver, sd->pat)) || (strcasestr(desc, sd->pat))) { + (xbps_pkgpattern_match(pkgver, sd->pat)) || xbps_array_add_cstring_nocopy(sd->results, pkgver); xbps_array_add_cstring_nocopy(sd->results, desc); } @@ -152,8 +152,7 @@ search_array_cb(struct xbps_handle *xhp _unused, printf("%s: %s\n", pkgver, str); } } else { - if ((strcasestr(str, sd->pat)) || - (fnmatch(sd->pat, str, FNM_PERIOD)) == 0) { + if (strcasestr(str, sd->pat)) { if (sd->repo_mode) printf("%s: %s (%s)\n", pkgver, str, sd->repourl); else