Commit Graph

715 Commits

Author SHA1 Message Date
David Korth
be85b3b4cd mz_compat.c: Fix zipOpen(), zipOpen64(), and unzOpen64().
The previous bugfixes fixed the functions that took a
zlib_filefunc_def* parameter, but they inadvertently broke the
functions that didn't. The fix is to store the filefunc pointer
locally, then pass a pointer to the pointer.
2017-11-12 11:32:40 -05:00
Nathan Moinvaziri
3da621e118
Fixed formatting. 2017-11-11 14:29:25 -08:00
Nathan Moinvaziri
211f14074a
Merge pull request #206 from GerbilSoft/bugfix/fix-mz_compat-2.2.3.v2
Fixes for the mz_compat layer.
2017-11-11 14:25:59 -08:00
David Korth
819d0d56f0 test.c: Use "%u" for printing uint32_t, not "%d".
Found using cppcheck-1.81.
2017-11-11 08:16:32 -05:00
David Korth
fa7fadebfa minizip.c: Check for 'k' and 'K', not 'k' and 'k'.
Found using cppcheck-1.81.
2017-11-11 08:16:32 -05:00
David Korth
a6e7d468e3 mz_compat.c: unzOpen2_64(): Go to the first file immediately.
MiniZip 1.x does this.

TODO: MiniZip 1.x also goes to the first disk when opening a Zip file
for write. Not sure if we should (or can) do that too...
2017-11-11 08:16:32 -05:00
David Korth
b8f7cf0fa7 mz_compat.c: unzGetCurrentFileInfo64(): Make sure filename and comment are NULL-terminated.
MiniZip 1.x always NULL-terminated these fields, but MiniZip 2.x does
not. This may break some programs that expect NULL-terminated fields
instead of using the explicit length.

Add a NULL terminator if there's enough space in the buffers.
2017-11-11 08:16:32 -05:00
David Korth
886df95632 mz_compat.c: unzClose(): Close the stream before destroying it.
Otherwise, we end up leaking the file handle. On Windows, the file is
opened with exclusive (non-shared) access, which prevents us from
opening the file again until the program exits.
2017-11-11 08:16:32 -05:00
David Korth
80c2d56436 mz_compat.c: Correctly dereference pzlib_filefunc_def.
In the fill_*() functions, not dereferencing `pzlib_filefunc_def`
results in the functions acting like nops.

In zipOpen2_64(), not dereferencing `pzlib_filefunc_def` causes it
to use the wrong pointer as the vtbl.
2017-11-11 08:16:32 -05:00
Nathan Moinvaziri
4f6a0e3fc1 Add ability to compile without zlib for LZMA support only. 2017-11-10 08:45:14 -08:00
Nathan Moinvaziri
91a76f61c9 Write bits 1 and 2 of general purpose bit based on compression method.
Remove zlib.h include from mz_zip.
2017-11-10 07:39:06 -08:00
Nathan Moinvaziri
0cdc6af8cd Added liblzma crc32 functions back in. 2017-11-10 07:34:02 -08:00
Nathan Moinvaziri
6186dd6dc6
Merge pull request #204 from tz-lom/patch-1
Fix compilation without encryption
2017-11-10 07:29:05 -08:00
Nathan Moinvaziri
bf26d0e7f7
Merge pull request #205 from tz-lom/patch-2
Add missed function
2017-11-10 07:28:17 -08:00
tz-lom
2aa8ed38a2
Add missed function 2017-11-10 15:04:39 +03:00
tz-lom
b1b25804fc
Fix compilation without encryption 2017-11-10 15:03:02 +03:00
Nathan Moinvaziri
053d00c451 Fixed forgot to uncomment out code. 2017-11-06 09:20:36 -08:00
Nathan Moinvaziri
b579191d9f Fixed file handle not closed in win32. (Issue #203) 2017-11-06 06:35:44 -08:00
Nathan Moinvaziri
db8df5bd96 Version 2.2.3. 2017-10-27 21:23:50 -07:00
Nathan Moinvaziri
507074781d Only check if disk exists when reading disk part. 2017-10-26 21:09:49 -07:00
Nathan Moinvaziri
62e7e2b0b9 Fixed bug not being able read across split disks properly. 2017-10-26 20:10:02 -07:00
Nathan Moinvaziri
f2b096a82e Fixed code that accidentally got removed. 2017-10-26 18:13:13 -07:00
Nathan Moinvaziri
ec6d4535ab Fixed bug reading directories in windows.
Fixed compiler warning in mz_get_file_crc.
2017-10-26 17:52:36 -07:00
Nathan Moinvaziri
83a886f154 Updated version numbers. 2017-10-26 17:07:14 -07:00
Nathan Moinvaziri
8d2ce022c1 Remove more unused files. 2017-10-26 17:05:32 -07:00
Nathan Moinvaziri
d42bff7e8f Merge branch 'dev' of https://github.com/nmoinvaz/minizip into dev 2017-10-26 16:48:18 -07:00
Nathan Moinvaziri
80fa033e18 Remove more unused liblzma files. 2017-10-26 16:46:34 -07:00
Nathan Moinvaziri
bd247ee400 Upgraded to liblzma 5.2.3.
Remove a bunch of unused files from liblzma.
2017-10-26 15:41:21 -07:00
Nathan Moinvaziri
76c44d530d Update README.md 2017-10-26 11:52:06 -07:00
Nathan Moinvaziri
1d82e28fd6 Fixed open flag in readme. 2017-10-26 11:50:20 -07:00
Nathan Moinvaziri
1250e1ea6a Fixed version number not being updated. 2017-10-26 10:48:02 -07:00
Nathan Moinvaziri
ddc57abe50 Version 2.2.2. 2017-10-26 10:26:58 -07:00
Nathan Moinvaziri
fdc695be86 Added zip memory test. 2017-10-26 10:21:21 -07:00
Nathan Moinvaziri
17cdaec2f7 Fixed don't save modified date if it is zero. 2017-10-26 10:18:41 -07:00
Nathan Moinvaziri
51f7250ce2 Fixed not uncompressing stream properly. 2017-10-26 10:15:21 -07:00
Nathan Moinvaziri
17fcdcdcb0 Check for null return value from localtime. 2017-10-26 08:13:13 -07:00
Nathan Moinvaziri
a9002ab444 Fixed printing of error code when listing zip. 2017-10-26 08:07:16 -07:00
Nathan Moinvaziri
28155e2ac6 Merge pull request #198 from rusdevops/patch-4
For C++ projects
2017-10-25 17:40:20 -04:00
Nathan Moinvaziri
088bfe65ec Also rename the callbacks. 2017-10-25 14:27:26 -07:00
Nathan Moinvaziri
f3d7fa8b81 Merge pull request #196 from rusdevops/patch-2
Update CMakeLists.txt
2017-10-25 15:26:35 -04:00
Nathan Moinvaziri
c51ebaf1be Merge pull request #197 from rusdevops/patch-3
Update README.md
2017-10-25 15:24:37 -04:00
rusdevops
a039e4468a Update mz_strm.c 2017-10-25 11:12:03 -07:00
rusdevops
3c305cfff3 Update mz_strm.h 2017-10-25 11:10:54 -07:00
rusdevops
b3a31e0e0a Update README.md 2017-10-25 11:06:55 -07:00
rusdevops
2ee84e0ff4 Update CMakeLists.txt
For the automatic including of the headers
2017-10-25 10:56:06 -07:00
Nathan Moinvaziri
fcc2dd8329 Merge pull request #195 from rusdevops/patch-2
Update mz_os_posix.h
2017-10-25 10:33:55 -04:00
Nathan Moinvaziri
750ad260f0 Update mz_os_posix.h 2017-10-25 07:33:29 -07:00
rusdevops
682a3213c3 Update CMakeLists.txt 2017-10-25 06:09:01 -07:00
rusdevops
ff6d1d5914 Update mz_os_posix.h 2017-10-25 05:50:39 -07:00
Nathan Moinvaziri
28cc486e44 Remove unused bzip2 file. 2017-10-23 22:43:25 -07:00