From f875ea9a52e7cbdbcfd150fe12624e0746894399 Mon Sep 17 00:00:00 2001 From: Jian Wang Date: Mon, 4 Mar 2024 20:59:06 +0100 Subject: [PATCH] Set default path separator to '/' in MSYS/MSYS2 The environments of MSYS: [[https://www.msys2.org/docs/environments/]] --- src/filesystem.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/filesystem.rs b/src/filesystem.rs index b9df0ba..83e55c9 100644 --- a/src/filesystem.rs +++ b/src/filesystem.rs @@ -128,13 +128,11 @@ pub fn strip_current_dir(path: &Path) -> &Path { pub fn default_path_separator() -> Option { if cfg!(windows) { let msystem = env::var("MSYSTEM").ok()?; - match msystem.as_str() { - "MINGW64" | "MINGW32" | "MSYS" => Some("/".to_owned()), - _ => None, + if !msystem.as_str().is_empty() { + return Some("/".to_owned()); } - } else { - None } + None } #[cfg(test)]