From fbc862ce91c1c492296b58e9a6ec13031c7147c2 Mon Sep 17 00:00:00 2001 From: Truman Kilen Date: Sun, 17 Sep 2023 19:49:39 -0500 Subject: [PATCH] Fix `get` command prefix handling --- repak_cli/src/main.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/repak_cli/src/main.rs b/repak_cli/src/main.rs index d2d373b..53c8b78 100644 --- a/repak_cli/src/main.rs +++ b/repak_cli/src/main.rs @@ -454,15 +454,15 @@ fn get(aes_key: Option, args: ActionGet) -> Result<(), repak::Error let mount_point = PathBuf::from(pak.mount_point()); let prefix = Path::new(&args.strip_prefix); - let full_path = mount_point.join(args.file); + let full_path = prefix.join(args.file); let file = full_path - .strip_prefix(prefix) + .strip_prefix(&mount_point) .map_err(|_| repak::Error::PrefixMismatch { path: full_path.to_string_lossy().to_string(), - prefix: prefix.to_string_lossy().to_string(), + prefix: mount_point.to_string_lossy().to_string(), })?; use std::io::Write; - std::io::stdout().write_all(&pak.get(&file.to_string_lossy(), &mut reader)?)?; + std::io::stdout().write_all(&pak.get(&file.to_slash_lossy(), &mut reader)?)?; Ok(()) }