From 81fc70864e58c38a1ba037256e5bffde07347b25 Mon Sep 17 00:00:00 2001 From: Dieter Baron Date: Thu, 20 Jun 2024 10:31:33 +0200 Subject: [PATCH] Fix adding/replacing files in torrentzips. --- TODO.md | 3 +-- lib/zip_extra_field_api.c | 4 ---- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/TODO.md b/TODO.md index caed74359..6989b4493 100644 --- a/TODO.md +++ b/TODO.md @@ -6,8 +6,7 @@ ### Torrentzip -- Handle data sources with unknown uncompressed size. -- Handle when uncompressed size < 4GB but compressed size > 4GB. +- Handle data sources with unknown uncompressed size: if we forced ZIP64 and don't need it, return specific error (so calling code can decide what to do (e. g. clear torrentzip flag and call `zip_close()` again)). ## Other diff --git a/lib/zip_extra_field_api.c b/lib/zip_extra_field_api.c index 560c71bb2..ff52afd1b 100644 --- a/lib/zip_extra_field_api.c +++ b/lib/zip_extra_field_api.c @@ -56,10 +56,6 @@ zip_file_extra_field_delete(zip_t *za, zip_uint64_t idx, zip_uint16_t ef_idx, zi zip_error_set(&za->error, ZIP_ER_RDONLY, 0); return -1; } - if (ZIP_WANT_TORRENTZIP(za)) { - zip_error_set(&za->error, ZIP_ER_NOT_ALLOWED, 0); - return -1; - } if (_zip_file_extra_field_prepare_for_change(za, idx) < 0) return -1;