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 B630013835A for ; Sat, 27 Jun 2020 09:38:13 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 00F19E0960; Sat, 27 Jun 2020 09:38:13 +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 DB292E0960 for ; Sat, 27 Jun 2020 09:38:12 +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 CE4F334F1E0 for ; Sat, 27 Jun 2020 09:38:11 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 431CB2B8 for ; Sat, 27 Jun 2020 09:38:10 +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: <1593250489.1b42d9bd178a8fddf8e31615ac37ce3bb9d94d16.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: 1b42d9bd178a8fddf8e31615ac37ce3bb9d94d16 X-VCS-Branch: master Date: Sat, 27 Jun 2020 09:38:10 +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: ab063971-e95c-4516-8fc5-3a6f8d83983f X-Archives-Hash: 54a1315e0fb34a028a37bc64f398a3bf commit: 1b42d9bd178a8fddf8e31615ac37ce3bb9d94d16 Author: Fabian Groffen gentoo org> AuthorDate: Sat Jun 27 09:34:49 2020 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Sat Jun 27 09:34:49 2020 +0000 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=1b42d9bd libq/tree: ensure tree_foreach_pkg_fast can be run multiple times too Signed-off-by: Fabian Groffen gentoo.org> libq/tree.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libq/tree.c b/libq/tree.c index ad8db47..e41a0cb 100644 --- a/libq/tree.c +++ b/libq/tree.c @@ -1477,6 +1477,8 @@ tree_foreach_pkg(tree_ctx *ctx, tree_pkg_cb callback, void *priv, /* allow foreach to be called again on the same open tree */ if (ctx->do_sort) scandir_free(ctx->cat_de, ctx->cat_cnt); + else + rewinddir(ctx->dir); ctx->cat_de = NULL; ctx->cat_cur = 0; ctx->cat_cnt = 0;