We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 70d2d1c commit e776ff0Copy full SHA for e776ff0
src/finder.rs
@@ -83,8 +83,12 @@ impl Finder {
83
}
84
_ => {
85
// Search binary in PATHs(defined in environment variable).
86
- let p = paths.ok_or(Error::CannotGetCurrentDirAndPathListEmpty)?;
87
- let paths: Vec<_> = env::split_paths(&p).collect();
+ let paths =
+ env::split_paths(&paths.ok_or(Error::CannotGetCurrentDirAndPathListEmpty)?)
88
+ .collect::<Vec<_>>();
89
+ if paths.is_empty() {
90
+ return Err(Error::CannotGetCurrentDirAndPathListEmpty);
91
+ }
92
93
Either::Right(Self::path_search_candidates(path, paths).into_iter())
94
0 commit comments