add missing special-case for ../

When I reviewed the fix for #952 I noted that "../" wasn't handled but in my
haste to merge it forgot to augment the pull-request.
This commit is contained in:
Kurtis Rader 2016-04-08 15:52:10 -07:00
parent 6c5f923a47
commit 6adc35c636

View file

@ -1818,8 +1818,9 @@ static expand_error_t expand_stage_wildcards(const wcstring &input, std::vector<
In either case, we ignore the path if we start with ./ or /. In either case, we ignore the path if we start with ./ or /.
Also ignore it if we are doing command completion and we contain a slash, per IEEE 1003.1, chapter 8 under PATH Also ignore it if we are doing command completion and we contain a slash, per IEEE 1003.1, chapter 8 under PATH
*/ */
if (string_prefixes_string(L"./", path_to_expand) || if (string_prefixes_string(L"/", path_to_expand) ||
string_prefixes_string(L"/", path_to_expand) || string_prefixes_string(L"./", path_to_expand) ||
string_prefixes_string(L"../", path_to_expand) ||
(for_command && path_to_expand.find(L'/') != wcstring::npos)) (for_command && path_to_expand.find(L'/') != wcstring::npos))
{ {
effective_working_dirs.push_back(working_dir); effective_working_dirs.push_back(working_dir);