mirror of
https://github.com/nushell/nushell.git
synced 2025-08-12 16:57:11 +02:00
Remove preceding \\?\ from path_abs UNC format
This commit is contained in:
@ -79,14 +79,16 @@ pub mod _impl {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
use path_abs::{PathAbs, PathInfo};
|
|
||||||
|
|
||||||
fn get_full_path_name_w(path_str: &str) -> Option<String> {
|
fn get_full_path_name_w(path_str: &str) -> Option<String> {
|
||||||
|
use path_abs::PathAbs;
|
||||||
if let Ok(path_abs) = PathAbs::new(path_str) {
|
if let Ok(path_abs) = PathAbs::new(path_str) {
|
||||||
Some(path_abs.to_str()?.to_string())
|
let full_path = path_abs.as_path().to_str()?;
|
||||||
} else {
|
// Remove the preceding \\?\ characters
|
||||||
None
|
if full_path.starts_with(r"\\?\") {
|
||||||
|
return Some(full_path[4..].to_string());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
None
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Global singleton instance of DrivePwdMap
|
/// Global singleton instance of DrivePwdMap
|
||||||
|
Reference in New Issue
Block a user