--- ./plugins/libarchive/libarchiveplugin.cpp.orig 2022-01-03 15:30:07.000000000 -0600 +++ ./plugins/libarchive/libarchiveplugin.cpp 2025-02-20 12:47:07.966005569 -0600 @@ -272,6 +272,11 @@ return false; } + // If this ends up empty (e.g. from // or ./), convert to ".". + if (entryName.isEmpty()) { + entryName = QStringLiteral("."); + } + // Should the entry be extracted? if (extractAll || remainingFiles.contains(entryName) || @@ -286,10 +291,12 @@ continue; } + // Make sure libarchive uses the same path as we expect, based on transformations and renames, + qCDebug(ARK) << "setting path to " << entryName; + archive_entry_copy_pathname(entry, QFile::encodeName(entryName).constData()); // entryFI is the fileinfo pointing to where the file will be // written from the archive. QFileInfo entryFI(entryName); - //qCDebug(ARK) << "setting path to " << archive_entry_pathname( entry ); const QString fileWithoutPath(entryFI.fileName()); // If we DON'T preserve paths, we cut the path and set the entryFI @@ -495,6 +502,7 @@ int LibarchivePlugin::extractionFlags() const { return ARCHIVE_EXTRACT_TIME + | ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS | ARCHIVE_EXTRACT_SECURE_NODOTDOT | ARCHIVE_EXTRACT_SECURE_SYMLINKS; }