Skip to content

Make [mz_zip.c] more modular #478

@karimhm

Description

@karimhm

In mz_zip.c the library check for both, HAVE_ZLIB and HAVE_LIBCOMP flags and then uses the Zlib interface even though on Apple platforms it might use the Libcomp interface that is "Catfishing" Zlib.

https://github.com/nmoinvaz/minizip/blob/b39f7a0e896615833a5af9dc7134563917a3a227/mz_zip.c#L1885-L1888

Wouldn't something like be better?

#if defined(HAVE_ZLIB)
    else if (zip->file_info.compression_method == MZ_COMPRESS_METHOD_DEFLATE)
        mz_stream_zlib_create(&zip->compress_stream);
#endif
#if defined(HAVE_LIBCOMP)
    else if (zip->file_info.compression_method == MZ_COMPRESS_METHOD_DEFLATE)
        mz_stream_libcomp_create(&zip->compress_stream);
#endif

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions