From 4e0799289351ba3b771bec5bef6b20015f33fedd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mikrut?= Date: Mon, 16 Oct 2023 08:01:32 +0200 Subject: [PATCH] BKF --- czkawka_core/src/common_directory.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/czkawka_core/src/common_directory.rs b/czkawka_core/src/common_directory.rs index 2759aa0..752dbc5 100644 --- a/czkawka_core/src/common_directory.rs +++ b/czkawka_core/src/common_directory.rs @@ -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); }