Skip to content

Commit

Permalink
Set default path separator to '/' in MSYS/MSYS2
Browse files Browse the repository at this point in the history
The environments of MSYS: [[https://www.msys2.org/docs/environments/]]
  • Loading branch information
Jian Wang committed Mar 13, 2024
1 parent 3b2fd15 commit ad2cc43
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/filesystem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,11 @@ pub fn strip_current_dir(path: &Path) -> &Path {
pub fn default_path_separator() -> Option<String> {
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)]
Expand Down

0 comments on commit ad2cc43

Please sign in to comment.