]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
zip: Fix test failure (#2304)
authoryyyy <yyyy@poipoipo.pub>
Sun, 1 Sep 2024 03:26:01 +0000 (11:26 +0800)
committerGitHub <noreply@github.com>
Sun, 1 Sep 2024 03:26:01 +0000 (20:26 -0700)
Fix `test_write_format_zip_stream` failure when `HAVE_ZLIB_H` is not
defined.

If `libz` is present, `zip` archives would be compressed by default,
which requires `zip_version=20`. Otherwise, the archive is not
compressed and only requires `zip_version=10`. I'm building libarchive
on a machine not intended for developing, so basicly there's no optional
dependencies like `libz` available, guess that's why nobody else has
reported this issue.

libarchive/test/test_write_format_zip_stream.c

index aff6a31ae1715f0d9f23e8ceadb15b6ffefd3715..6619aa7f35fbcbb7202d24cf2234ac9704c15607 100644 (file)
@@ -82,6 +82,7 @@ DEFINE_TEST(test_write_format_zip_stream)
        const char *file_name = "file";
 
 #ifndef HAVE_ZLIB_H
+       zip_version = 10;
        zip_compression = 0;
 #endif