diff --git a/src/libutil/archive.cc b/src/libutil/archive.cc index b978ac4db..3d96df75e 100644 --- a/src/libutil/archive.cc +++ b/src/libutil/archive.cc @@ -187,8 +187,10 @@ static void parse(FileSystemObjectSink & sink, Source & source, const CanonPath tag = getString(); } - if (tag == "contents") - parseContents(crf, source); + if (tag != "contents") + throw badArchive("expected tag 'contents', got '%s'", tag); + + parseContents(crf, source); expectTag(")"); });