mirror of
https://github.com/storytold/deckcraft.git
synced 2026-11-13 05:33:27 +00:00
Keep backslash zip entry names with forward slashes so later lookups split them
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
939bd12832
commit
ba29b61f8c
1 file changed
+3
-1
@@ -93,7 +93,8 @@ impl Package {
|
||||
}
|
||||
}
|
||||
total = total.saturating_add(data.len() as u64);
|
||||
parts.insert(norm(&name), (name, data));
|
||||
// A name kept with `\` would reach code that splits paths on `/`.
|
||||
parts.insert(norm(&name), (name.replace('\\', "/"), data));
|
||||
}
|
||||
Ok(Package { parts, ct_cache: std::sync::OnceLock::new() })
|
||||
}
|
||||
@@ -504,6 +505,7 @@ mod tests {
|
||||
let z = zip_of(&[("PPT\\Slides\\Slide1.xml", 3)]);
|
||||
let p = Package::open(&z).unwrap();
|
||||
assert!(p.get("ppt/slides/slide1.xml").is_some());
|
||||
assert_eq!(p.original_name("ppt/slides/slide1.xml"), Some("PPT/Slides/Slide1.xml"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in new issue
Block a user