From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 4B47859CAF for ; Fri, 1 Apr 2016 21:42:49 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6DD2B21C01B; Fri, 1 Apr 2016 21:42:48 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id D8CB421C01B for ; Fri, 1 Apr 2016 21:42:47 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id A066C340DDA for ; Fri, 1 Apr 2016 21:42:46 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id B29D27C for ; Fri, 1 Apr 2016 21:42:43 +0000 (UTC) From: "Mike Frysinger" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" Message-ID: <1459546811.46aea99b4b973d29db4f717fa72bcf3e1cb80f22.vapier@gentoo> Subject: [gentoo-commits] proj/portage-utils:master commit in: / X-VCS-Repository: proj/portage-utils X-VCS-Files: qsearch.c X-VCS-Directories: / X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: 46aea99b4b973d29db4f717fa72bcf3e1cb80f22 X-VCS-Branch: master Date: Fri, 1 Apr 2016 21:42:43 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 30223b6a-9a86-4a80-8ed8-07a8c7404d10 X-Archives-Hash: 5c46ee5d28773c2d3238e306076c1da5 commit: 46aea99b4b973d29db4f717fa72bcf3e1cb80f22 Author: Mike Frysinger gentoo org> AuthorDate: Fri Apr 1 21:40:11 2016 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Fri Apr 1 21:40:11 2016 +0000 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=46aea99b qsearch: fix dirname/basename calls Since dirname might modify its argument, make sure we call basename first so we don't end up with the dirname twice. URL: https://bugs.gentoo.org/578758 Reported-by: Kolbjørn Barmen kolla.no> qsearch.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qsearch.c b/qsearch.c index e23642b..1ebfccf 100644 --- a/qsearch.c +++ b/qsearch.c @@ -119,8 +119,9 @@ qsearch_ebuild_ebuild(int overlay_fd, const char *ebuild, const char *search_me, } if (show_it) { + const char *pkg = basename(p); printf("%s%s/%s%s%s %s\n", - BOLD, dirname(p), BLUE, basename(p), NORM, + BOLD, dirname(p), BLUE, pkg, NORM, (show_name_only ? "" : q ? : "")); }