chore: Tweaks to make version_needed and version_made_by work with recently-merged changes

This commit is contained in:
Chris Hennick 2024-05-24 21:55:18 -07:00
parent cda4712153
commit 92012b9795
No known key found for this signature in database
GPG key ID: DA47AABA4961C509
2 changed files with 2 additions and 5 deletions

View file

@ -770,7 +770,7 @@ impl ZipFileData {
.unwrap_or_else(DateTime::default_for_write); .unwrap_or_else(DateTime::default_for_write);
ZipCentralEntryBlock { ZipCentralEntryBlock {
magic: ZipCentralEntryBlock::MAGIC, magic: ZipCentralEntryBlock::MAGIC,
version_made_by: (self.system as u16) << 8 | (self.version_made_by as u16), version_made_by: (self.system as u16) << 8 | (self.version_made_by as u16).max(self.version_needed()),
version_to_extract: self.version_needed(), version_to_extract: self.version_needed(),
flags: self.flags(), flags: self.flags(),
compression_method: self.compression_method.serialize_to_u16(), compression_method: self.compression_method.serialize_to_u16(),

View file

@ -795,10 +795,7 @@ impl<W: Write + Seek> ZipWriter<W> {
aes_mode, aes_mode,
extra_field, extra_field,
); );
let version_needed = file.version_needed(); file.version_made_by = file.version_made_by.max(file.version_needed() as u8);
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 index = self.insert_file_data(file)?;
let file = &mut self.files[index]; let file = &mut self.files[index];
let writer = self.inner.get_plain(); let writer = self.inner.get_plain();