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());
|
||||
|
||||
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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue