forked from lix-project/lix
parent
0b6bff5455
commit
c7a7652725
|
@ -87,13 +87,16 @@ static void extract_archive(TarArchive & archive, const Path & destDir)
|
||||||
struct archive_entry * entry;
|
struct archive_entry * entry;
|
||||||
int r = archive_read_next_header(archive.archive, &entry);
|
int r = archive_read_next_header(archive.archive, &entry);
|
||||||
if (r == ARCHIVE_EOF) break;
|
if (r == ARCHIVE_EOF) break;
|
||||||
else if (r == ARCHIVE_WARN)
|
auto name = archive_entry_pathname(entry);
|
||||||
|
if (!name)
|
||||||
|
throw Error("cannot get archive member name: %s", archive_error_string(archive.archive));
|
||||||
|
if (r == ARCHIVE_WARN)
|
||||||
warn(archive_error_string(archive.archive));
|
warn(archive_error_string(archive.archive));
|
||||||
else
|
else
|
||||||
archive.check(r);
|
archive.check(r);
|
||||||
|
|
||||||
archive_entry_set_pathname(entry,
|
archive_entry_set_pathname(entry,
|
||||||
(destDir + "/" + archive_entry_pathname(entry)).c_str());
|
(destDir + "/" + name).c_str());
|
||||||
|
|
||||||
archive.check(archive_read_extract(archive.archive, entry, flags));
|
archive.check(archive_read_extract(archive.archive, entry, flags));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue