Update src/nix/prefetch.cc

Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
(cherry picked from commit 05381c0b30)
This commit is contained in:
Jörg Thalheim
2024-07-05 19:45:03 +02:00
committed by github-actions[bot]
parent 73f3179954
commit d58592469d

View File

@@ -117,7 +117,7 @@ std::tuple<StorePath, Hash> prefetchFile(
/* If the archive unpacks to a single file/directory, then use
that as the top-level. */
tmpFile = entries->path();
unsigned fileCount = std::distance(entries, std::filesystem::directory_iterator{});
auto fileCount = std::distance(entries, std::filesystem::directory_iterator{});
if (fileCount != 1) {
/* otherwise, use the directory itself */
tmpFile = unpacked;