diff options
author | Vicent Marti | 2008-09-30 11:53:37 +0000 |
---|---|---|
committer | Vicent Marti | 2008-09-30 11:53:37 +0000 |
commit | 87917e06d94e36c483011deaf1eb4a5dba6eeb97 (patch) | |
tree | a02995f93cba9d4bc6d89c3ac6b25eb14ac8c127 | |
parent | a7005b84ff3c9573e656d1709f2fbb4dcd78f4b6 (diff) | |
download | scummvm-rg350-87917e06d94e36c483011deaf1eb4a5dba6eeb97.tar.gz scummvm-rg350-87917e06d94e36c483011deaf1eb4a5dba6eeb97.tar.bz2 scummvm-rg350-87917e06d94e36c483011deaf1eb4a5dba6eeb97.zip |
Fixed functionality of ZipArchive::getAllNames(). Now it expects a possibly non-empty string list and returns the amount of new filenames added to it.
svn-id: r34698
-rw-r--r-- | common/unzip.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/common/unzip.cpp b/common/unzip.cpp index 775a6e2dab..24744203da 100644 --- a/common/unzip.cpp +++ b/common/unzip.cpp @@ -1400,14 +1400,15 @@ int ZipArchive::getAllNames(Common::StringList &list) { 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; } /* |