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 128E7138346 for ; Sun, 5 Jan 2020 16:08:34 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4F71CE08D9; Sun, 5 Jan 2020 16:08:33 +0000 (UTC) Received: from smtp.gentoo.org (mail.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 3481EE08D9 for ; Sun, 5 Jan 2020 16:08:33 +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 E2D6534DDC6 for ; Sun, 5 Jan 2020 16:08:31 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 5B60A3D for ; Sun, 5 Jan 2020 16:08:30 +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: <1578233007.dbccc4073df47013409eec4e333f32aca80383c4.grobian@gentoo> Subject: [gentoo-commits] proj/portage-utils:master commit in: / X-VCS-Repository: proj/portage-utils X-VCS-Files: qlist.c X-VCS-Directories: / X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: dbccc4073df47013409eec4e333f32aca80383c4 X-VCS-Branch: master Date: Sun, 5 Jan 2020 16:08:30 +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: 608da93b-a52f-4d11-887f-37d906d137e7 X-Archives-Hash: 2753749805212aa59fb803b1ed16c7b1 commit: dbccc4073df47013409eec4e333f32aca80383c4 Author: Fabian Groffen gentoo org> AuthorDate: Sun Jan 5 14:03:27 2020 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Sun Jan 5 14:03:27 2020 +0000 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=dbccc407 qlist: use tree_pkg_meta_get iso tree_pkg_vdb_eat tree_pkg_meta_get also works for binpkgs (-k) Signed-off-by: Fabian Groffen gentoo.org> qlist.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/qlist.c b/qlist.c index cc4c6be..506e3e5 100644 --- a/qlist.c +++ b/qlist.c @@ -104,8 +104,6 @@ umapstr(char display, tree_pkg_ctx *pkg_ctx) char *bufp = _umapstr_buf; char *use = NULL; char *iuse = NULL; - size_t use_len; - size_t iuse_len; int use_argc = 0; int iuse_argc = 0; char **use_argv = NULL; @@ -118,11 +116,11 @@ umapstr(char display, tree_pkg_ctx *pkg_ctx) if (!display) return bufp; - tree_pkg_vdb_eat(pkg_ctx, "USE", &use, &use_len); - if (!use[0]) + use = tree_pkg_meta_get(pkg_ctx, USE); + if (use == NULL || *use == '\0') return bufp; - tree_pkg_vdb_eat(pkg_ctx, "IUSE", &iuse, &iuse_len); - if (!iuse[0]) + iuse = tree_pkg_meta_get(pkg_ctx, IUSE); + if (iuse == NULL || *iuse == '\0') return bufp; /* strip out possible leading +/- flags in IUSE */ @@ -167,8 +165,6 @@ umapstr(char display, tree_pkg_ctx *pkg_ctx) freeargv(iuse_argc, iuse_argv); freeargv(use_argc, use_argv); - free(iuse); - free(use); return _umapstr_buf; }