From 87ba4e3bb0495735a81a332526f6ee774e2f457a Mon Sep 17 00:00:00 2001 From: "J.W" Date: Thu, 26 Oct 2017 15:18:05 +0800 Subject: [PATCH] Fix root directory for Windows --- src/main.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index da0cfff..05ea591 100644 --- a/src/main.rs +++ b/src/main.rs @@ -58,7 +58,12 @@ fn main() { // Get the root directory for the search let mut root_dir_buf = match matches.value_of("path") { - Some(path) => PathBuf::from(path), + Some(path) => { + #[cfg(windows)] + let path = path.replace('/', "\\"); + + PathBuf::from(path) + } None => current_dir.to_path_buf(), }; if !fshelper::is_dir(&root_dir_buf) {