1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-29 19:03:16 +02:00

Fix readDir for accessors whose readDirectory doesn't return types

This commit is contained in:
Eelco Dolstra 2022-12-02 16:46:54 +01:00
parent 39a783ffff
commit 116acc108e

View file

@ -1670,12 +1670,9 @@ static void prim_readDir(EvalState & state, const PosIdx pos, Value * * args, Va
auto attrs = state.buildBindings(entries.size());
for (auto & [name, type] : entries) {
#if 0
// FIXME?
if (type == InputAccessor::Type::Misc)
type = getFileType(path + "/" + name);
#endif
attrs.alloc(name).mkString(fileTypeToString(type.value_or(InputAccessor::Type::tMisc)));
if (!type)
type = (path + name).lstat().type;
attrs.alloc(name).mkString(fileTypeToString(*type));
}
v.mkAttrs(attrs);