mirror of
https://github.com/zealdocs/zeal.git
synced 2024-11-22 21:53:03 +03:00
fix(core): create root directory before extracting files
This fixes a bug where files in the root directory of an archive would not be extracted if they are encountered before any other directory. The reason is that QFile::open() cannot create directories.
This commit is contained in:
parent
bab39cd883
commit
803db6ae34
@ -59,6 +59,9 @@ void Extractor::extract(const QString &sourceFile, const QString &destination, c
|
||||
destinationDir.setPath(destinationDir.filePath(root));
|
||||
}
|
||||
|
||||
// Destination directory must be created before any other files.
|
||||
destinationDir.mkpath(QLatin1String("."));
|
||||
|
||||
// TODO: Do not strip root directory in archive if it equals to 'root'
|
||||
archive_entry *entry;
|
||||
while (archive_read_next_header(info.archiveHandle, &entry) == ARCHIVE_OK) {
|
||||
|
Loading…
Reference in New Issue
Block a user