summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRagnar Thomsen <rthomsen6@gmail.com>2016-10-01 19:39:17 (GMT)
committerRagnar Thomsen <rthomsen6@gmail.com>2016-10-01 19:39:17 (GMT)
commite67866a52cb401aaf8153d0e3081c706e9c3a414 (patch)
tree4aba24f56faa928915afd75440eca9fa745a7bc5
parent99b42b95964ab9e4f78adeefdd6a95e8f946ee32 (diff)
Fix extraction of selected entries from AppImage
Extraction of selected entries from AppImages was curently broken. This was because when libarchive lists the AppImage all entries are prepended with "./", which results in entry paths not matching those in ArchiveModel. This commit removes the "./" in LibarchivePlugin::extractFiles(). Differential Revision: D2905
-rw-r--r--plugins/libarchive/libarchiveplugin.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/plugins/libarchive/libarchiveplugin.cpp b/plugins/libarchive/libarchiveplugin.cpp
index 00ebafd..da59a7b 100644
--- a/plugins/libarchive/libarchiveplugin.cpp
+++ b/plugins/libarchive/libarchiveplugin.cpp
@@ -219,6 +219,11 @@ bool LibarchivePlugin::extractFiles(const QList<Archive::Entry*> &files, const Q
// entryName is the name inside the archive, full path
QString entryName = QDir::fromNativeSeparators(QFile::decodeName(archive_entry_pathname(entry)));
+ // Some archive types e.g. AppImage prepend all entries with "./" so remove this part.
+ if (entryName.startsWith(QLatin1String("./"))) {
+ entryName.remove(0, 2);
+ }
+
// For now we just can't handle absolute filenames in a tar archive.
// TODO: find out what to do here!!
if (entryName.startsWith(QLatin1Char( '/' ))) {