Closed
Description
cc: @kballard
If I understand windows verbatim paths correctly, a path like \\?\a\b\
should not normalize away that last trailing slash. WindowsPath::new
does this correctly. However, if we break up the paths into \\?a
and b\
and use push to join the paths, that trailing slash is removed:
fn main() {
let path = WindowsPath::new("\\\\?\\a\\b\\");
println!("{:?}\n{}\n{:?}", path, path.display(), path.str_components().to_owned_vec());
let mut path = WindowsPath::new("\\\\?\\a");
path.push("b\\");
println!("{:?}\n{}\n{:?}", path, path.display(), path.str_components().to_owned_vec());
}
std::path::windows::Path{repr: ~"\\\\?\\a\\b\\", prefix: Some(VerbatimPrefix(1u)), sepidx: Some(5u)}
\\?\a\b\
~[Some("b")]
std::path::windows::Path{repr: ~"\\\\?\\a\\b", prefix: Some(VerbatimPrefix(1u)), sepidx: Some(5u)}
\\?\a\b
~[Some("b")]