aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2018-12-09 11:40:07 +0100
committerFabian Groffen <grobian@gentoo.org>2018-12-09 11:40:07 +0100
commit8ccd45be3ade13b4bef748b7486a87b3d143afc1 (patch)
tree476c8749957a60793b9db94e1c6b6adb19f2c3cd
parentqdepends: match reverse deps without SLOT if not given (diff)
downloadportage-utils-8ccd45be3ade13b4bef748b7486a87b3d143afc1.tar.gz
portage-utils-8ccd45be3ade13b4bef748b7486a87b3d143afc1.tar.bz2
portage-utils-8ccd45be3ade13b4bef748b7486a87b3d143afc1.zip
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 <grobian@gentoo.org>
-rw-r--r--qsearch.c9
1 files 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 - <solar@gentoo.org>
* Copyright 2005-2014 Mike Frysinger - <vapier@gentoo.org>
+ * Copyright 2018- Fabian Groffen - <grobian@gentoo.org
*/
#ifdef APPLET_qsearch
@@ -50,8 +51,9 @@ qsearch_ebuild_metadata(_q_unused_ int overlay_fd, const char *ebuild, const cha
if (strcmp(pcache->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 ? : "<no DESCRIPTION found>"));
}