From 6f47ecba928440cad18406a26dc3e0909fe88cd8 Mon Sep 17 00:00:00 2001 From: Andrey Kutejko Date: Wed, 3 Apr 2024 18:27:52 +0200 Subject: [PATCH] Use case-insensitive comparison to find a part file in Xlsx ZIP archive --- src/xlsx/mod.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/xlsx/mod.rs b/src/xlsx/mod.rs index 2aba53e4..3f98f861 100644 --- a/src/xlsx/mod.rs +++ b/src/xlsx/mod.rs @@ -919,7 +919,11 @@ fn xml_reader<'a, RS: Read + Seek>( zip: &'a mut ZipArchive, path: &str, ) -> Option, XlsxError>> { - match zip.by_name(path) { + let actual_path = zip + .file_names() + .find(|n| n.eq_ignore_ascii_case(path))? + .to_owned(); + match zip.by_name(&actual_path) { Ok(f) => { let mut r = XmlReader::from_reader(BufReader::new(f)); r.check_end_names(false)