fix: ignore absolute paths when extracting
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
parent
6be7eed878
commit
e70a5a47ee
@ -306,6 +306,11 @@ std::optional<QStringList> MMCZip::extractSubDir(QuaZip *zip, const QString & su
|
|||||||
name.remove(0, subdir.size());
|
name.remove(0, subdir.size());
|
||||||
auto original_name = name;
|
auto original_name = name;
|
||||||
|
|
||||||
|
// Fix subdirs/files ending with a / getting transformed into absolute paths
|
||||||
|
if(name.startsWith('/')){
|
||||||
|
name = name.mid(1);
|
||||||
|
}
|
||||||
|
|
||||||
// Fix weird "folders with a single file get squashed" thing
|
// Fix weird "folders with a single file get squashed" thing
|
||||||
QString path;
|
QString path;
|
||||||
if(name.contains('/') && !name.endsWith('/')){
|
if(name.contains('/') && !name.endsWith('/')){
|
||||||
|
Loading…
Reference in New Issue
Block a user