mirror of
https://github.com/NixOS/nix.git
synced 2025-11-29 05:31:00 +01: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:
parent
7317196807
commit
511590976c
5 changed files with 7 additions and 6 deletions
|
|
@ -61,6 +61,7 @@ CanonPath CanonPath::operator + (const CanonPath & x) const
|
|||
void CanonPath::push(std::string_view c)
|
||||
{
|
||||
assert(c.find('/') == c.npos);
|
||||
assert(c != "." && c != "..");
|
||||
if (!isRoot()) path += '/';
|
||||
path += c;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue