From e6b2290f70390e5df56d62d5efad4fa179268eb0 Mon Sep 17 00:00:00 2001 From: Chris Hennick <4961925+Pr0methean@users.noreply.github.com> Date: Fri, 24 May 2024 21:58:26 -0700 Subject: [PATCH] chore: Another tweak to ensure `version_needed` is applied --- src/types.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/types.rs b/src/types.rs index a185d02f..9fd325b0 100644 --- a/src/types.rs +++ b/src/types.rs @@ -591,7 +591,7 @@ impl ZipFileData { let permissions = options.permissions.unwrap_or(0o100644); let file_name: Box = name.into(); let file_name_raw: Box<[u8]> = file_name.bytes().collect(); - ZipFileData { + let mut local_block = ZipFileData { system: System::Unix, version_made_by: DEFAULT_VERSION, encrypted: options.encrypt_with.is_some(), @@ -616,7 +616,9 @@ impl ZipFileData { extra_fields: Vec::new(), extra_data_start, aes_extra_data_start, - } + }; + local_block.version_made_by = local_block.version_made_by.max(local_block.version_needed() as u8); + local_block } pub(crate) fn from_local_block(