diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2012-05-05 14:30:20 -0700 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2012-05-05 14:30:20 -0700 |
commit | 3be07cc64506477e2bf195b7c297b8d6d3050173 (patch) | |
tree | c1b4774e63115e7ae52e6261a9f787fa9c4c1618 /path.cpp | |
parent | 07f5319472ed7c052b25aec7d29e92126b9bca48 (diff) |
Fix to start re-respecting CDPATH
Diffstat (limited to 'path.cpp')
-rw-r--r-- | path.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -289,9 +289,16 @@ bool path_get_cdpath_string(const wcstring &dir_str, wcstring &result, const env } else { - - const wchar_t *path = L"."; + + const wchar_t *path = L"."; + // Respect CDPATH + env_var_t cdpath = env_get_string(L"CDPATH"); + if (! cdpath.missing_or_empty()) { + path = cdpath.c_str(); + printf("CDPATH: %ls\n", path); + } + wcstokenizer tokenizer(path, ARRAY_SEP_STR); wcstring next_path; while (tokenizer.next(next_path)) @@ -368,7 +375,9 @@ wchar_t *path_allocate_cdpath( const wchar_t *dir, const wchar_t *wd ) wchar_t *state; wchar_t *whole_path; - env_var_t path = L"."; + // Respect CDPATH + env_var_t path = env_get_string(L"CDPATH"); + if (path.missing_or_empty()) path = L"."; path_cpy = wcsdup( path.c_str() ); |