two more /tmp references that aren't necessary

Eliminate two more references to /tmp as part of removing our dependency
on /tmp being a valid directory.
This commit is contained in:
Kurtis Rader 2017-04-08 21:47:05 -07:00
parent 49518b71ab
commit 8440308470

View file

@ -631,13 +631,13 @@ void wildcard_expander_t::expand_trailing_slash(const wcstring &base_dir, const
}
if (!(flags & EXPAND_FOR_COMPLETIONS)) {
// Trailing slash and not accepting incomplete, e.g. `echo /tmp/`. Insert this file if it
// Trailing slash and not accepting incomplete, e.g. `echo /xyz/`. Insert this file if it
// exists.
if (waccess(base_dir, F_OK) == 0) {
this->add_expansion_result(base_dir);
}
} else {
// Trailing slashes and accepting incomplete, e.g. `echo /tmp/<tab>`. Everything is added.
// Trailing slashes and accepting incomplete, e.g. `echo /xyz/<tab>`. Everything is added.
DIR *dir = open_dir(base_dir);
if (dir) {
wcstring next;