From fc1c92458045de8a6db408da29a7b8274fed931a Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Wed, 21 Feb 2018 10:07:35 -0500 Subject: just always use $PWD std::env::current_dir() canonicalizes symlinks (i think only the shell itself keeps track of the path without doing that) --- src/system_info.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/system_info.rs b/src/system_info.rs index d0f609b..8790cf4 100644 --- a/src/system_info.rs +++ b/src/system_info.rs @@ -21,13 +21,9 @@ pub fn terminal_cols() -> Option { } pub fn pwd() -> Option { - std::env::current_dir() + std::env::var("PWD") + .map(|pwd| std::path::PathBuf::from(pwd)) .ok() - .or_else(|| { - std::env::var("PWD") - .map(|pwd| std::path::PathBuf::from(pwd)) - .ok() - }) } pub fn home() -> Option { -- cgit v1.2.3-54-g00ecf