1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-20 17:29:36 +01:00

add call to checkInterrupt in a bunch of places

This brings back the old behaviour. We check for interrupts in places
that may iterate over wide directories.

(cherry picked from commit 8f1a26667e)
This commit is contained in:
siddhantCodes 2024-06-04 19:35:40 +05:30 committed by github-actions[bot]
parent 180dfa44b2
commit af8a1715e1
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());