diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2012-05-06 14:53:19 -0700 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2012-05-06 14:53:19 -0700 |
commit | 99b51ce6eadcc93027c6edf9a0def836ac050870 (patch) | |
tree | a5a985c2f9dc1ffd18cbdfc8266a0107d54d6699 /complete.cpp | |
parent | e0baab2722b54e044baa13b4321e1e40a2e0be7b (diff) |
Fix to better support CDPATH
Diffstat (limited to 'complete.cpp')
-rw-r--r-- | complete.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/complete.cpp b/complete.cpp index fd51b226..b3218a3e 100644 --- a/complete.cpp +++ b/complete.cpp @@ -1009,8 +1009,12 @@ void completer_t::complete_cmd( const wcstring &str, bool use_function, bool use wchar_t *state; std::vector<completion_t> possible_comp; - wchar_t *cdpath_cpy = wcsdup(L"."); + env_var_t cdpath = env_get_string(L"CDPATH"); + if (cdpath.missing_or_empty()) + cdpath = L"."; + wchar_t *cdpath_cpy = wcsdup(cdpath.c_str()); + const bool wants_description = (type == COMPLETE_DEFAULT); if( (wcschr( cmd, L'/') != 0) || (cmd[0] == L'~' ) ) |