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:
parent
39a783ffff
commit
116acc108e
1 changed files with 3 additions and 6 deletions
|
@ -1670,12 +1670,9 @@ static void prim_readDir(EvalState & state, const PosIdx pos, Value * * args, Va
|
||||||
auto attrs = state.buildBindings(entries.size());
|
auto attrs = state.buildBindings(entries.size());
|
||||||
|
|
||||||
for (auto & [name, type] : entries) {
|
for (auto & [name, type] : entries) {
|
||||||
#if 0
|
if (!type)
|
||||||
// FIXME?
|
type = (path + name).lstat().type;
|
||||||
if (type == InputAccessor::Type::Misc)
|
attrs.alloc(name).mkString(fileTypeToString(*type));
|
||||||
type = getFileType(path + "/" + name);
|
|
||||||
#endif
|
|
||||||
attrs.alloc(name).mkString(fileTypeToString(type.value_or(InputAccessor::Type::tMisc)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
v.mkAttrs(attrs);
|
v.mkAttrs(attrs);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue