empty CDPATH elements are equivalent to "."

In the process of fixing the issue I decided it didn't make sense to
have two, incompatible, ways of converting variable strings to arrays.
Especially since the one I'm removing does not return empty array elements.

Fixes #2106
This commit is contained in:
Kurtis Rader
2017-03-16 20:59:04 -07:00
parent 570a6430ad
commit ae0321778f
6 changed files with 50 additions and 75 deletions

View File

@@ -1919,22 +1919,6 @@ scoped_rwlock::~scoped_rwlock() {
}
}
wcstokenizer::wcstokenizer(const wcstring &s, const wcstring &separator)
: buffer(), str(), state(), sep(separator) {
buffer = wcsdup(s.c_str());
str = buffer;
state = NULL;
}
bool wcstokenizer::next(wcstring &result) {
wchar_t *tmp = wcstok(str, sep.c_str(), &state);
str = NULL;
if (tmp) result = tmp;
return tmp != NULL;
}
wcstokenizer::~wcstokenizer() { free(buffer); }
template <typename CharType_t>
static CharType_t **make_null_terminated_array_helper(
const std::vector<std::basic_string<CharType_t> > &argv) {