summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qzip.cpp
diff options
context:
space:
mode:
authorMatthias Behr <mbehr@mcbehr.de>2024-11-16 08:44:19 +0100
committerMatthias Behr <mbehr@mcbehr.de>2024-11-18 21:51:21 +0100
commit4f9cbd5b2892f0f72c74db05d05c67f25e7c99e7 (patch)
tree45874aa8124b23109fd7d4c89dabe9cbb66f815b /src/corelib/io/qzip.cpp
parent8a535cc1049c4304754b380daaefdece3a7c2e5b (diff)
QZipReader: extractAll should not create dir for root entries
QZipReader::extractAll handles zip files without dir entries in a way that it creates the dirs automatically. Fixed this logic for files in the root of the zip file by skipping those. Fixes: QTBUG-131008 Change-Id: Ia7cde0f2762f4566564e8524b71f43834158f09c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io/qzip.cpp')
-rw-r--r--src/corelib/io/qzip.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/corelib/io/qzip.cpp b/src/corelib/io/qzip.cpp
index 173563ec29a..1e3d5f5859e 100644
--- a/src/corelib/io/qzip.cpp
+++ b/src/corelib/io/qzip.cpp
@@ -1009,6 +1009,8 @@ bool QZipReader::extractAll(const QString &destinationDir) const
// need to recreate directory structure based on the file paths.
if (hasDirs && !foundDirs) {
for (const FileInfo &fi : allFiles) {
+ if (!fi.filePath.contains(u"/"))
+ continue;
const auto dirPath = fi.filePath.left(fi.filePath.lastIndexOf(u"/"));
if (!baseDir.mkpath(dirPath))
return false;