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

Fix handling of relative paths

In particular, 'path:..' got turned into 'path:.' because isRelative()
returned a CanonPath, which cannot represent '..'.

Reported by @erikarvstedt.
This commit is contained in:
Eelco Dolstra 2022-10-10 18:56:19 +02:00
parent 7317196807
commit 511590976c
5 changed files with 7 additions and 6 deletions

View file

@ -434,7 +434,7 @@ LockedFlake lockFlake(
if (auto relativePath = input.ref->input.isRelative()) {
SourcePath inputSourcePath {
overridenSourcePath.accessor,
*overridenSourcePath.path.parent() + *relativePath
CanonPath(*relativePath, *overridenSourcePath.path.parent())
};
return readFlake(state, *input.ref, *input.ref, *input.ref, inputSourcePath, inputPath);
} else