diff --git a/modules/juce_core/zip/juce_ZipFile.cpp b/modules/juce_core/zip/juce_ZipFile.cpp index 7c6392a421..532000f6c5 100644 --- a/modules/juce_core/zip/juce_ZipFile.cpp +++ b/modules/juce_core/zip/juce_ZipFile.cpp @@ -111,21 +111,21 @@ namespace class ZipFile::ZipInputStream : public InputStream { public: - ZipInputStream (ZipFile& file_, ZipFile::ZipEntryHolder& zei) - : file (file_), + ZipInputStream (ZipFile& zf, ZipFile::ZipEntryHolder& zei) + : file (zf), zipEntryHolder (zei), pos (0), headerSize (0), - inputStream (file_.inputStream) + inputStream (zf.inputStream) { - if (file_.inputSource != nullptr) + if (zf.inputSource != nullptr) { inputStream = streamToDelete = file.inputSource->createInputStream(); } else { #if JUCE_DEBUG - file_.streamCounter.numOpenStreams++; + zf.streamCounter.numOpenStreams++; #endif } @@ -233,9 +233,9 @@ ZipFile::ZipFile (const File& file) init(); } -ZipFile::ZipFile (InputSource* const inputSource_) +ZipFile::ZipFile (InputSource* const source) : inputStream (nullptr), - inputSource (inputSource_) + inputSource (source) { init(); } @@ -391,9 +391,15 @@ Result ZipFile::uncompressEntry (const int index, { const ZipEntryHolder* zei = entries.getUnchecked (index); - const File targetFile (targetDirectory.getChildFile (zei->entry.filename)); + #if JUCE_WINDOWS + const String entryPath (zei->entry.filename); + #else + const String entryPath (zei->entry.filename.replaceCharacter ('\\', '/')); + #endif - if (zei->entry.filename.endsWithChar ('/')) + const File targetFile (targetDirectory.getChildFile (entryPath)); + + if (entryPath.endsWithChar ('/') || entryPath.endsWithChar ('\\')) return targetFile.createDirectory(); // (entry is a directory, not a file) ScopedPointer in (createStreamForEntry (index)); @@ -431,15 +437,15 @@ Result ZipFile::uncompressEntry (const int index, //============================================================================= -extern unsigned long juce_crc32 (unsigned long crc, const unsigned char* buf, unsigned len); +extern unsigned long juce_crc32 (unsigned long crc, const unsigned char*, unsigned len); class ZipFile::Builder::Item { public: - Item (const File& file_, const int compressionLevel_, const String& storedPathName_) - : file (file_), - storedPathname (storedPathName_.isEmpty() ? file_.getFileName() : storedPathName_), - compressionLevel (compressionLevel_), + Item (const File& f, const int compression, const String& storedPath) + : file (f), + storedPathname (storedPath.isEmpty() ? f.getFileName() : storedPath), + compressionLevel (compression), compressedSize (0), headerStart (0) {