X-Original-To: alpine-devel@mail.alpinelinux.org Delivered-To: alpine-devel@mail.alpinelinux.org Received: from mail.alpinelinux.org (dallas-a1.alpinelinux.org [127.0.0.1]) by mail.alpinelinux.org (Postfix) with ESMTP id 3D8E3DC04E2 for ; Wed, 10 Jun 2015 03:29:25 +0000 (UTC) Received: from mail.koorogi.info (koorogi.info [198.74.62.75]) by mail.alpinelinux.org (Postfix) with ESMTP id 09666DC020A for ; Wed, 10 Jun 2015 03:29:19 +0000 (UTC) Received: from dora.lan (h184-60-17-243.mdsnwi.dsl.dynamic.tds.net [184.60.17.243]) by mail.koorogi.info (Postfix) with ESMTPSA id 135DAE3E0 for ; Tue, 9 Jun 2015 22:29:19 -0500 (CDT) Date: Tue, 9 Jun 2015 22:29:17 -0500 From: Bobby Bingham To: alpine-devel@lists.alpinelinux.org Subject: [alpine-devel] [PATCH] Fix apk search --description Message-ID: <20150610032917.GA5164@dora.lan> X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="/WwmFnJnmDyWGHa4" Content-Disposition: inline X-Operating-System: Linux dora 3.18.14 User-Agent: Mutt/1.5.23 (2014-03-12) X-Virus-Scanned: ClamAV using ClamSMTP --/WwmFnJnmDyWGHa4 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline `apk search --description` doesn't work correctly, because the needle and haystack arguments are swapped in a couple calls to strstr. The attached patch fixes this. -- Bobby Bingham --/WwmFnJnmDyWGHa4 Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="search-description.patch" Content-Transfer-Encoding: quoted-printable commit 2d168068969cecbe65c722673fb9a9ffe2cdf6f3 Author: Bobby Bingham Date: Tue Jun 9 22:03:27 2015 -0500 search: fix swapped needle and haystack diff --git a/src/search.c b/src/search.c index 47339fd..5833325 100644 --- a/src/search.c +++ b/src/search.c @@ -122,8 +122,8 @@ static void print_result_pkg(struct search_ctx *ctx, st= ruct apk_package *pkg) =20 if (ctx->search_description) { foreach_array_item(pmatch, ctx->filter) { - if (strstr(*pmatch, pkg->description) !=3D NULL || - strstr(*pmatch, pkg->name->name) !=3D NULL) + if (strstr(pkg->description, *pmatch) !=3D NULL || + strstr(pkg->name->name, *pmatch) !=3D NULL) goto match; } return; --/WwmFnJnmDyWGHa4-- --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---