diff --git a/crates/nu-path/Cargo.toml b/crates/nu-path/Cargo.toml index 2a81c7daad..22ab716d14 100644 --- a/crates/nu-path/Cargo.toml +++ b/crates/nu-path/Cargo.toml @@ -16,7 +16,6 @@ dirs = { workspace = true } [target.'cfg(windows)'.dependencies] omnipath = { workspace = true } -path_abs = "0.5.1" [target.'cfg(all(unix, not(target_os = "macos"), not(target_os = "android")))'.dependencies] pwd = { workspace = true } diff --git a/crates/nu-path/src/pwd_per_drive.rs b/crates/nu-path/src/pwd_per_drive.rs index 3cb390953e..6d6980c79f 100644 --- a/crates/nu-path/src/pwd_per_drive.rs +++ b/crates/nu-path/src/pwd_per_drive.rs @@ -171,15 +171,12 @@ pub mod _impl { } fn get_full_path_name_w(path_str: &str) -> Option { - use path_abs::PathAbs; - if let Ok(path_abs) = PathAbs::new(path_str) { - let full_path = path_abs.as_path().to_str()?; - // Remove the preceding \\?\ characters - if full_path.starts_with(r"\\?\") { - return Some(full_path[4..].to_string()); - } + use omnipath::sys_absolute; + if let Ok(path_sys_abs) = sys_absolute(PathBuf::from(path_str).as_path()) { + Some(path_sys_abs.to_str()?.to_string()) + } else { + None } - None } use std::sync::{Mutex, OnceLock};