fix: version-needed-to-extract was incorrect in central header, and version-made-by could be lower than that (#100)

This commit is contained in:
Chris Hennick 2024-05-24 14:24:25 -07:00
parent b057d0dca2
commit cda4712153
No known key found for this signature in database
GPG key ID: DA47AABA4961C509

View file

@ -797,6 +797,8 @@ impl<W: Write + Seek> ZipWriter<W> {
);
let version_needed = file.version_needed();
file.version_made_by = file.version_made_by.max(version_needed as u8);
let version_needed = file.version_needed();
file.version_made_by = file.version_made_by.max(version_needed as u8);
let index = self.insert_file_data(file)?;
let file = &mut self.files[index];
let writer = self.inner.get_plain();