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 74D99138335 for ; Thu, 26 Sep 2019 14:06:52 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BCECAE09A5; Thu, 26 Sep 2019 14:06:51 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (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 A50C6E09A5 for ; Thu, 26 Sep 2019 14:06:51 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (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 3B60834B5DB for ; Thu, 26 Sep 2019 14:06:50 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 758FC4D3 for ; Thu, 26 Sep 2019 14:06:47 +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: <1569504144.d500e279f02bd5b58407975da145b1334c33e696.grobian@gentoo> Subject: [gentoo-commits] proj/portage-utils:master commit in: libq/ X-VCS-Repository: proj/portage-utils X-VCS-Files: libq/tree.c X-VCS-Directories: libq/ X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: d500e279f02bd5b58407975da145b1334c33e696 X-VCS-Branch: master Date: Thu, 26 Sep 2019 14:06:47 +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: 85307d08-6132-40f4-8a4f-589341052938 X-Archives-Hash: 6705387a1e46bd45c7a1724f832595f8 commit: d500e279f02bd5b58407975da145b1334c33e696 Author: Fabian Groffen gentoo org> AuthorDate: Thu Sep 26 13:22:24 2019 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Thu Sep 26 13:22:24 2019 +0000 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=d500e279 libq/tree: simplify atom construction in tree_get_atoms_cb Signed-off-by: Fabian Groffen gentoo.org> libq/tree.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libq/tree.c b/libq/tree.c index f8d90ce..8caed00 100644 --- a/libq/tree.c +++ b/libq/tree.c @@ -1061,10 +1061,9 @@ static int tree_get_atoms_cb(tree_pkg_ctx *pkg_ctx, void *priv) char abuf[BUFSIZ]; if (state->fullcpv) { - size_t len = snprintf(abuf, sizeof(abuf), "%s/%s-%s", - atom->CATEGORY, atom->PN, atom->PV); - if (atom->PR_int > 0) - snprintf(abuf + len, sizeof(abuf) - len, "-r%d", atom->PR_int); + snprintf(abuf, sizeof(abuf), "%s/%s-%s", + atom->CATEGORY, atom->PN, + atom->PR_int > 0 ? atom->PVR : atom->PV); state->cpf = add_set(abuf, state->cpf); } else { snprintf(abuf, sizeof(abuf), "%s/%s", atom->CATEGORY, atom->PN);