diff options
author | Willem Jan Palenstijn | 2013-04-18 23:37:54 +0200 |
---|---|---|
committer | Willem Jan Palenstijn | 2013-05-08 20:46:44 +0200 |
commit | 02c5cc75a7cb8885d2a0fa141fbc0e763c5b31a0 (patch) | |
tree | 72b64a67ebeca41e9b83593da80850e848a99e2e /common/unzip.cpp | |
parent | 1539023834a2ad7cf8942711d60983891a10a82a (diff) | |
parent | 1e200620d673af4acdd2d128ed6e390df001aacf (diff) | |
download | scummvm-rg350-02c5cc75a7cb8885d2a0fa141fbc0e763c5b31a0.tar.gz scummvm-rg350-02c5cc75a7cb8885d2a0fa141fbc0e763c5b31a0.tar.bz2 scummvm-rg350-02c5cc75a7cb8885d2a0fa141fbc0e763c5b31a0.zip |
Merge branch 'master'
Conflicts:
configure
base/plugins.cpp
Diffstat (limited to 'common/unzip.cpp')
-rw-r--r-- | common/unzip.cpp | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/common/unzip.cpp b/common/unzip.cpp index 8cfcd605fa..ab659343a2 100644 --- a/common/unzip.cpp +++ b/common/unzip.cpp @@ -1463,22 +1463,16 @@ bool ZipArchive::hasFile(const String &name) const { } int ZipArchive::listMembers(ArchiveMemberList &list) const { - int matches = 0; - int err = unzGoToFirstFile(_zipFile); + int members = 0; - while (err == UNZ_OK) { - char szCurrentFileName[UNZ_MAXFILENAMEINZIP+1]; - if (unzGetCurrentFileInfo(_zipFile, NULL, - szCurrentFileName, sizeof(szCurrentFileName)-1, - NULL, 0, NULL, 0) == UNZ_OK) { - list.push_back(ArchiveMemberList::value_type(new GenericArchiveMember(szCurrentFileName, this))); - matches++; - } - - err = unzGoToNextFile(_zipFile); + const unz_s *const archive = (const unz_s *)_zipFile; + for (ZipHash::const_iterator i = archive->_hash.begin(), end = archive->_hash.end(); + i != end; ++i) { + list.push_back(ArchiveMemberList::value_type(new GenericArchiveMember(i->_key, this))); + ++members; } - return matches; + return members; } const ArchiveMemberPtr ZipArchive::getMember(const String &name) const { |