1
0
Fork 0
mirror of synced 2024-05-17 19:03:08 +12:00
This commit is contained in:
Rafał Mikrut 2023-10-16 08:01:32 +02:00
parent b32785aae7
commit 4e07992893

View file

@ -140,8 +140,10 @@ impl Directories {
// This can be check by checking if path starts with \\?\UNC\
if let Ok(dir_can) = directory.canonicalize() {
let dir_can_str = dir_can.to_string_lossy().to_string();
if dir_can_str.starts_with(r"\\?\") && dir_can_str.chars().nth(5) == Some(':') {
directory = PathBuf::from(dir_can_str);
if let Some(dir_can_str) = dir_can_str.strip_prefix(r"\\?\") {
if dir_can_str.chars().nth(1) == Some(':') {
directory = PathBuf::from(dir_can_str);
}
}
dbg!("After canonicalize", &directory);
}