diff options
-rw-r--r-- | src/clients/cave/executables_common.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/clients/cave/executables_common.cc b/src/clients/cave/executables_common.cc index 47891c16c..699397bd4 100644 --- a/src/clients/cave/executables_common.cc +++ b/src/clients/cave/executables_common.cc @@ -124,8 +124,13 @@ paludis::cave::executables_common( throw BeMoreSpecific(spec, entries); const std::string path(getenv_or_error("PATH")); + std::set<std::string> raw_paths; + tokenise<delim_kind::AnyOfTag, delim_mode::DelimiterTag>(path, ":", "", std::inserter(raw_paths, raw_paths.begin())); + std::set<std::string> paths; - tokenise<delim_kind::AnyOfTag, delim_mode::DelimiterTag>(path, ":", "", std::inserter(paths, paths.begin())); + for (const std::string& raw_path : raw_paths) + paths.insert(stringify(FSPath(raw_path).realpath_if_exists())); + ExecutablesDisplayer ed(paths, displayer); for (auto i(best ? entries->last() : entries->begin()), i_end(entries->end()) ; |