mirror of
https://github.com/NixOS/nix
synced 2025-06-25 10:41:16 +02:00
Replace our DirEntry
with std::filesystem
's
This commit is contained in:
parent
c371070580
commit
a3c573950b
18 changed files with 52 additions and 59 deletions
|
@ -260,8 +260,9 @@ StringSet NixRepl::completePrefix(const std::string & prefix)
|
|||
auto dir = std::string(cur, 0, slash);
|
||||
auto prefix2 = std::string(cur, slash + 1);
|
||||
for (auto & entry : readDirectory(dir == "" ? "/" : dir)) {
|
||||
if (entry.name[0] != '.' && hasPrefix(entry.name, prefix2))
|
||||
completions.insert(prev + dir + "/" + entry.name);
|
||||
auto name = entry.path().filename().string();
|
||||
if (name[0] != '.' && hasPrefix(name, prefix2))
|
||||
completions.insert(prev + entry.path().string());
|
||||
}
|
||||
} catch (Error &) {
|
||||
} catch (std::filesystem::filesystem_error &) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue