Skip to content

Commit 27c7fa4

Browse files
committed
chore: Fix a failing unit test
1 parent 9a27fb8 commit 27c7fa4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/read.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::crc32::Crc32Reader;
88
use crate::extra_fields::{ExtendedTimestamp, ExtraField};
99
use crate::read::zip_archive::{Shared, SharedBuilder};
1010
use crate::result::{ZipError, ZipResult};
11-
use crate::spec::{self, FixedSizeBlock, Zip32CentralDirectoryEnd};
11+
use crate::spec::{self, FixedSizeBlock, Zip32CentralDirectoryEnd, ZIP64_ENTRY_THR};
1212
use crate::types::{
1313
AesMode, AesVendorVersion, DateTime, System, ZipCentralEntryBlock, ZipFileData,
1414
ZipLocalEntryBlock,
@@ -772,7 +772,8 @@ impl<R: Read + Seek> ZipArchive<R> {
772772
}
773773
Err(e) => invalid_errors.push(e),
774774
Ok(o) => {
775-
if o.files.len() >= footer.number_of_files as usize {
775+
if o.files.len() == footer.number_of_files as usize
776+
|| footer.number_of_files == ZIP64_ENTRY_THR as u16 {
776777
ok_results.push((footer.clone(), o))
777778
} else {
778779
invalid_errors.push(InvalidArchive("wrong number of files"))

0 commit comments

Comments
 (0)