Skip to content

Commit

Permalink
Use the zipOpenNewFileInZip2 signature for compatibility with minizip-ng
Browse files Browse the repository at this point in the history
This has the same signature in both minizip-ng and the original minizip, which doesn't seem to be the case for zipOpenNewFileInZip64

Bug: #478
  • Loading branch information
cameronwhite committed Jun 9, 2024
1 parent 4544a98 commit f6662dd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Thanks to the following contributors who worked on this release:
- Fixed issues where the top fret number of a chord diagram could be cut off in the chord name dialog (#408)
- Fixed a crash when an alternate ending was located on the last position of a system (#449)
- Fixed a crash during playback when a score contained a `Fine` symbol (#470)
- Fixed build errors with `minizip-ng` (#478)

## [Alpha 19] - 2022-10-17

Expand Down
6 changes: 4 additions & 2 deletions source/formats/gp7/gp7exporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "document.h"

#include <memory>
#include <zlib.h>
#include <minizip/zip.h>
#ifdef _WIN32
#include <minizip/iowin32.h>
Expand Down Expand Up @@ -76,9 +77,10 @@ struct ZipFileEntry
{
ZipFileEntry(zipFile file, const char *filename) : myFile(file)
{
if (zipOpenNewFileInZip64(myFile, filename, nullptr, nullptr, 0,
// Note: using the 2_64 signature for improved compatibility with minizip-ng (bug #478)
if (zipOpenNewFileInZip2_64(myFile, filename, nullptr, nullptr, 0,
nullptr, 0, nullptr, Z_DEFLATED,
Z_DEFAULT_COMPRESSION, 1) != ZIP_OK)
Z_DEFAULT_COMPRESSION, 0, 1) != ZIP_OK)
{
throw FileFormatException("Failed to create file entry.");
}
Expand Down

0 comments on commit f6662dd

Please sign in to comment.