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

Merge pull request #10852 from siddhantk232/add-interrupts

add call to `checkInterrupt` in a bunch of places
This commit is contained in:
Eelco Dolstra 2024-06-04 17:21:03 +02:00 committed by GitHub
commit ef140c25d1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 29 additions and 3 deletions

View file

@ -261,6 +261,7 @@ StringSet NixRepl::completePrefix(const std::string & prefix)
auto dir = std::string(cur, 0, slash);
auto prefix2 = std::string(cur, slash + 1);
for (auto & entry : std::filesystem::directory_iterator{dir == "" ? "/" : dir}) {
checkInterrupt();
auto name = entry.path().filename().string();
if (name[0] != '.' && hasPrefix(name, prefix2))
completions.insert(prev + entry.path().string());