Skip to content

Commit

Permalink
Merge pull request #419 from andy128k/case-insensitive-xlsx
Browse files Browse the repository at this point in the history
Use case-insensitive comparison to find a part file in Xlsx ZIP archive
  • Loading branch information
tafia committed Apr 15, 2024
2 parents 953d80e + 6f47ecb commit bb13f61
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 bb13f61

Please sign in to comment.