From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 3D6E8138334 for ; Sun, 9 Dec 2018 10:42:11 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id F36C0E0821; Sun, 9 Dec 2018 10:42:09 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id C8E83E0821 for ; Sun, 9 Dec 2018 10:42:09 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id D28E1335C47 for ; Sun, 9 Dec 2018 10:42:06 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 2DE8E4CE for ; Sun, 9 Dec 2018 10:42:05 +0000 (UTC) From: "Fabian Groffen" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Fabian Groffen" Message-ID: <1544352007.8ccd45be3ade13b4bef748b7486a87b3d143afc1.grobian@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: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: 8ccd45be3ade13b4bef748b7486a87b3d143afc1 X-VCS-Branch: master Date: Sun, 9 Dec 2018 10:42:05 +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-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: aeba3544-18da-4752-a7c0-214bc4dfa030 X-Archives-Hash: 9443e23e51bb183490aa73664a752e8c commit: 8ccd45be3ade13b4bef748b7486a87b3d143afc1 Author: Fabian Groffen gentoo org> AuthorDate: Sun Dec 9 10:40:07 2018 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Sun Dec 9 10:40:07 2018 +0000 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=8ccd45be qsearch: avoid printing a trailing space, bug #672764 When --name-only is in effect, don't print the space separating the package and its description, for we won't print the latter. Bug: https://bugs.gentoo.org/672764 Signed-off-by: Fabian Groffen gentoo.org> qsearch.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/qsearch.c b/qsearch.c index 4fce4de..b75a4f7 100644 --- a/qsearch.c +++ b/qsearch.c @@ -1,9 +1,10 @@ /* - * Copyright 2005-2018 Gentoo Foundation + * Copyright 2005-2018 Gentoo Authors * Distributed under the terms of the GNU General Public License v2 * * Copyright 2005-2010 Ned Ludd - * Copyright 2005-2014 Mike Frysinger - + * Copyright 2018- Fabian Groffen - atom->PN, last) != 0) { strncpy(last, pcache->atom->PN, LAST_BUF_SIZE); if (search_all || rematch(search_me, (search_desc ? pcache->DESCRIPTION : ebuild), REG_EXTENDED | REG_ICASE) == 0) - printf("%s%s/%s%s%s %s\n", BOLD, pcache->atom->CATEGORY, BLUE, + printf("%s%s/%s%s%s%s%s\n", BOLD, pcache->atom->CATEGORY, BLUE, pcache->atom->PN, NORM, + (show_name_only ? "" : " "), (show_name_only ? "" : (show_homepage ? pcache->HOMEPAGE : pcache->DESCRIPTION))); } @@ -121,8 +123,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", + printf("%s%s/%s%s%s%s%s\n", BOLD, dirname(p), BLUE, pkg, NORM, + (show_name_only ? "" : " "), (show_name_only ? "" : q ? : "")); }