From fe4d6a80dadeed7051c49df36a0cc058f3325ded Mon Sep 17 00:00:00 2001 From: Lance Date: Wed, 13 Feb 2008 14:09:02 +0000 Subject: [PATCH] Fix for ZIP code in engine, incorrectly reporting Zip Error for .PK3's which were fine. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2921 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/common/fs.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/engine/common/fs.c b/engine/common/fs.c index b8b2d6301..744cb924c 100644 --- a/engine/common/fs.c +++ b/engine/common/fs.c @@ -1026,6 +1026,7 @@ of the list so they override previous pack files. static void *FSZIP_LoadZipFile (vfsfile_t *packhandle, char *desc) { int i; + int nextfileziphandle; zipfile_t *zip; packfile_t *newfiles; @@ -1055,7 +1056,11 @@ static void *FSZIP_LoadZipFile (vfsfile_t *packhandle, char *desc) Q_strlwr(newfiles[i].name); newfiles[i].filelen = file_info.uncompressed_size; newfiles[i].filepos = file_info.c_offset; - if (unzGoToNextFile (zip->handle) != UNZ_OK) + + nextfileziphandle = unzGoToNextFile (zip->handle); + if (nextfileziphandle == UNZ_END_OF_LIST_OF_FILE) + break; + else if (nextfileziphandle != UNZ_OK) Con_Printf("Zip Error\n"); }