NAR parser: Fix check for duplicate / incorrectly sorted entries

"prevName" was always empty because it was declared in the wrong scope.

(cherry picked from commit 495d32e1b8)
This commit is contained in:
Eelco Dolstra 2024-09-04 21:43:59 +02:00
parent ae486b2910
commit 12fa019ae5

View File

@ -214,11 +214,13 @@ static void parse(FileSystemObjectSink & sink, Source & source, const CanonPath
else if (t == "directory") {
sink.createDirectory(path);
std::string prevName;
while (1) {
s = getString();
if (s == "entry") {
std::string name, prevName;
std::string name;
s = getString();
if (s != "(") throw badArchive("expected open tag");