Skip to content

Commit

Permalink
Use case-insensitive comparison to find a part file in Xlsx ZIP archive
Browse files Browse the repository at this point in the history
  • Loading branch information
andy128k committed Apr 3, 2024
1 parent 953d80e commit 6f47ecb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/xlsx/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,11 @@ fn xml_reader<'a, RS: Read + Seek>(
zip: &'a mut ZipArchive<RS>,
path: &str,
) -> Option<Result<XlReader<'a>, 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)
Expand Down

0 comments on commit 6f47ecb

Please sign in to comment.