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

Fix decoding virtual paths that are at the root of the tree

This commit is contained in:
Eelco Dolstra 2022-11-25 17:50:44 +01:00
parent b27cd882ac
commit 515b908690
2 changed files with 4 additions and 3 deletions

View file

@ -40,9 +40,8 @@ SourcePath EvalState::decodePath(std::string_view s, PosIdx pos)
try {
auto slash = s.find('/');
if (slash == std::string::npos) fail();
size_t number = std::stoi(std::string(s, 0, slash), nullptr, 16);
s = s.substr(slash);
size_t number = std::stoi(std::string(s.substr(0, slash)), nullptr, 16);
s = slash == s.npos ? "" : s.substr(slash);
auto accessor = inputAccessors.find(number);
if (accessor == inputAccessors.end()) fail();