diff --git a/src/uucore/src/lib/features/fs.rs b/src/uucore/src/lib/features/fs.rs index d1c0a3f7c..6fda8460a 100644 --- a/src/uucore/src/lib/features/fs.rs +++ b/src/uucore/src/lib/features/fs.rs @@ -39,7 +39,7 @@ pub fn resolve_relative_path(path: &Path) -> Cow { return path.into(); } let root = Component::RootDir.as_os_str(); - let mut result = env::current_dir().unwrap_or(PathBuf::from(root)); + let mut result = env::current_dir().unwrap_or_else(|_| PathBuf::from(root)); for comp in path.components() { match comp { Component::ParentDir => {