diff --git a/src/dircolors/dircolors.rs b/src/dircolors/dircolors.rs index 834f64fbe..6fd82f336 100644 --- a/src/dircolors/dircolors.rs +++ b/src/dircolors/dircolors.rs @@ -36,11 +36,12 @@ pub enum OutputFmt { } pub fn guess_syntax() -> OutputFmt { - use std::path; + use std::path::Path; match env::var("SHELL") { Ok(ref s) if !s.is_empty() => { - if let Some(last) = s.rsplit(path::MAIN_SEPARATOR).next() { - if last == "csh" || last == "tcsh" { + let shell_path: &Path = s.as_ref(); + if let Some(name) = shell_path.file_name() { + if name == "csh" || name == "tcsh" { OutputFmt::CShell } else { OutputFmt::Shell