1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-04 07:11:47 +02:00

use CanonPath in fs-sink and its derivatives

This commit is contained in:
siddhantCodes 2024-06-30 19:03:15 +05:30
parent 32e6cc64b5
commit 72bb530141
12 changed files with 73 additions and 79 deletions

View file

@ -165,7 +165,7 @@ struct CaseInsensitiveCompare
};
static void parse(FileSystemObjectSink & sink, Source & source, const Path & path)
static void parse(FileSystemObjectSink & sink, Source & source, const CanonPath & path)
{
std::string s;
@ -246,7 +246,7 @@ static void parse(FileSystemObjectSink & sink, Source & source, const Path & pat
}
} else if (s == "node") {
if (name.empty()) throw badArchive("entry name missing");
parse(sink, source, path + "/" + name);
parse(sink, source, path / name);
} else
throw badArchive("unknown field " + s);
}
@ -290,7 +290,7 @@ void parseDump(FileSystemObjectSink & sink, Source & source)
}
if (version != narVersionMagic1)
throw badArchive("input doesn't look like a Nix archive");
parse(sink, source, "");
parse(sink, source, CanonPath{""});
}