mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-10 05:32:40 -05:00
ZipUtil: check zip file external attributes for folder.
Folders in a zip file usually but not necessarily have their filename ending with a slash. In these cases recognizing a folder entry by the last character fails. Check the external attributes as well, which also contain the FAT file attributes. Change-Id: I81b039b3774b803b2b528bc83846aafd208e5571
This commit is contained in:
parent
f8aa5c4ec0
commit
f494c3c325
1 changed files with 6 additions and 0 deletions
|
|
@ -100,6 +100,12 @@ bool ZipUtil::extractArchive(QString& dest, QString file)
|
||||||
// if the entry is a path ignore it. Path existence is ensured separately.
|
// if the entry is a path ignore it. Path existence is ensured separately.
|
||||||
if(m_zip->getCurrentFileName().split("/").last() == "")
|
if(m_zip->getCurrentFileName().split("/").last() == "")
|
||||||
continue;
|
continue;
|
||||||
|
// some tools set the MS-DOS file attributes. Check those for D flag,
|
||||||
|
// since in some cases a folder entry does not end with a /
|
||||||
|
QuaZipFileInfo fi;
|
||||||
|
currentFile->getFileInfo(&fi);
|
||||||
|
if(fi.externalAttr & 0x10) // FAT entry bit 4 indicating directory
|
||||||
|
continue;
|
||||||
|
|
||||||
QString outfilename;
|
QString outfilename;
|
||||||
if(!singleoutfile.isEmpty()
|
if(!singleoutfile.isEmpty()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue