diff options
Diffstat (limited to 'cli/ops')
-rw-r--r-- | cli/ops/fs.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/cli/ops/fs.rs b/cli/ops/fs.rs index c5d1458fc..8542b5230 100644 --- a/cli/ops/fs.rs +++ b/cli/ops/fs.rs @@ -941,10 +941,9 @@ fn op_realpath_sync( // corresponds to the realpath on Unix and // CreateFile and GetFinalPathNameByHandle on Windows let realpath = std::fs::canonicalize(&path)?; - let mut realpath_str = - into_string(realpath.into_os_string())?.replace("\\", "/"); + let mut realpath_str = into_string(realpath.into_os_string())?; if cfg!(windows) { - realpath_str = realpath_str.trim_start_matches("//?/").to_string(); + realpath_str = realpath_str.trim_start_matches("\\\\?\\").to_string(); } Ok(json!(realpath_str)) } @@ -971,10 +970,9 @@ async fn op_realpath_async( // corresponds to the realpath on Unix and // CreateFile and GetFinalPathNameByHandle on Windows let realpath = std::fs::canonicalize(&path)?; - let mut realpath_str = - into_string(realpath.into_os_string())?.replace("\\", "/"); + let mut realpath_str = into_string(realpath.into_os_string())?; if cfg!(windows) { - realpath_str = realpath_str.trim_start_matches("//?/").to_string(); + realpath_str = realpath_str.trim_start_matches("\\\\?\\").to_string(); } Ok(json!(realpath_str)) }) |