Skip to content

Commit

Permalink
fix for paths on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan-rsm-McKenzie committed Jan 24, 2024
1 parent 4a39359 commit 9c55711
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/fo4/archive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ mod tests {
Borrowed,
};
use anyhow::Context as _;
use bstr::ByteSlice as _;
use bstr::{BString, ByteSlice as _};
use memmap2::Mmap;
use std::{
fs,
Expand Down Expand Up @@ -649,7 +649,15 @@ mod tests {
let mappings: Vec<_> = keys
.iter()
.map(|key| {
let path: PathBuf = [root.as_os_str(), key.name().to_os_str_lossy().as_ref()]
let file_name: BString = key
.name()
.bytes()
.map(|x| match x {
b'\\' => b'/',
_ => x,
})
.collect();
let path: PathBuf = [root.as_os_str(), file_name.to_os_str_lossy().as_ref()]
.into_iter()
.collect();
let fd = fs::File::open(&path)
Expand Down

0 comments on commit 9c55711

Please sign in to comment.