- fixed: Dp mot strip the top level folder name in Zips if they only contain one entry or if the first entry isn't a directory.

This commit is contained in:
Christoph Oelckers 2017-02-27 01:53:51 +01:00
parent c8445703ac
commit 1e1194a669

View file

@ -220,7 +220,7 @@ bool FZipFile::Open(bool quiet)
// Check if all files have the same prefix so that this can be stripped out.
FString name0;
for (DWORD i = 0; i < NumLumps; i++)
if (NumLumps > 1) for (DWORD i = 0; i < NumLumps; i++)
{
FZipCentralDirectoryInfo *zip_fh = (FZipCentralDirectoryInfo *)dirptr;
@ -244,6 +244,7 @@ bool FZipFile::Open(bool quiet)
{
// check for special names, if one of these gets found this must be treated as a normal zip.
bool isspecial = !name.Compare("flats/") ||
name.IndexOf("/") < 0 ||
!name.Compare("textures/") ||
!name.Compare("hires/") ||
!name.Compare("sprites/") ||