aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorVicent Marti2008-09-30 11:55:32 +0000
committerVicent Marti2008-09-30 11:55:32 +0000
commite290a3b6f3cf2fd1b686230126a8a27451cabdff (patch)
tree511ed496f3a0c6a07043e9dcf98da9b7dd8c43a7 /common
parentb15a6a9a152ce9e056c72f62d8299c982884f15b (diff)
downloadscummvm-rg350-e290a3b6f3cf2fd1b686230126a8a27451cabdff.tar.gz
scummvm-rg350-e290a3b6f3cf2fd1b686230126a8a27451cabdff.tar.bz2
scummvm-rg350-e290a3b6f3cf2fd1b686230126a8a27451cabdff.zip
Ported ZipArchive::getAllNames() fix from trunk.
svn-id: r34699
Diffstat (limited to 'common')
-rw-r--r--common/unzip.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/common/unzip.cpp b/common/unzip.cpp
index bdba2a544a..24744203da 100644
--- a/common/unzip.cpp
+++ b/common/unzip.cpp
@@ -1395,19 +1395,20 @@ bool ZipArchive::hasFile(const Common::String &name) {
int ZipArchive::getAllNames(Common::StringList &list) {
if (!_zipFile)
return 0;
-
+
if (unzGoToFirstFile(_zipFile) != UNZ_OK)
return 0;
char fileNameBuffer[UNZ_MAXFILENAMEINZIP + 1];
- list.clear();
-
+ int fileCount = 0;
+
do {
unzGetCurrentFileInfo(_zipFile, 0, fileNameBuffer, UNZ_MAXFILENAMEINZIP + 1, 0, 0, 0, 0);
list.push_back(Common::String(fileNameBuffer));
+ fileCount++;
} while (unzGoToNextFile(_zipFile) == UNZ_OK);
-
- return list.size();
+
+ return fileCount;
}
/*