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 0A24F1382C5 for ; Mon, 25 May 2020 11:06:29 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3CCF9E083E; Mon, 25 May 2020 11:06:28 +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 01FAFE083E for ; Mon, 25 May 2020 11:06:27 +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 9BB2634F013 for ; Mon, 25 May 2020 11:06:26 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 87C6C242 for ; Mon, 25 May 2020 11:06:24 +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: <1590404616.a68b9b4ebc840805f504fe681196e7f15737985d.grobian@gentoo> Subject: [gentoo-commits] proj/portage-utils:master commit in: libq/ X-VCS-Repository: proj/portage-utils X-VCS-Files: libq/atom.c X-VCS-Directories: libq/ X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: a68b9b4ebc840805f504fe681196e7f15737985d X-VCS-Branch: master Date: Mon, 25 May 2020 11:06:24 +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: 8cb40f53-81a9-43c8-b96f-de4673157c9a X-Archives-Hash: 97a265c2ab4d83aaf93cd488abac1784 commit: a68b9b4ebc840805f504fe681196e7f15737985d Author: Fabian Groffen gentoo org> AuthorDate: Mon May 25 11:03:36 2020 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Mon May 25 11:03:36 2020 +0000 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=a68b9b4e libq/atom: fixup USE-dep printing in atom_format Bug: https://bugs.gentoo.org/724892 Signed-off-by: Fabian Groffen gentoo.org> libq/atom.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/libq/atom.c b/libq/atom.c index 7e72bf3..acf28be 100644 --- a/libq/atom.c +++ b/libq/atom.c @@ -939,12 +939,20 @@ atom_format_r( } else if (!strncmp("USE", fmt, len)) { if (showit || atom->usedeps) { atom_usedep *ud; - append_buf(buf, buflen, "%s", "["); - for (ud = atom->usedeps; ud != NULL; ud = ud->next) - append_buf(buf, buflen, "%s%s%s%s%s%s", - MAGENTA, atom_usecond_str[ud->pfx_cond], - ud->use, atom_usecond_str[ud->sfx_cond], - NORM, ud->next == NULL ? "]" : ","); + if (atom->usedeps == NULL) { + append_buf(buf, buflen, "%s", ""); + } else { + if (connected) + append_buf(buf, buflen, "%s", "["); + for (ud = atom->usedeps; ud != NULL; ud = ud->next) + append_buf(buf, buflen, "%s%s%s%s%s%s", + MAGENTA, atom_usecond_str[ud->pfx_cond], + ud->use, atom_usecond_str[ud->sfx_cond], + NORM, ud->next == NULL ? "" : + (connected ? "," : " ")); + if (connected) + append_buf(buf, buflen, "%s", "]"); + } } } else append_buf(buf, buflen, "", (int)len, fmt);