mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-14 05:53:59 +00:00
Fix to start re-respecting CDPATH
This commit is contained in:
parent
07f5319472
commit
3be07cc645
2 changed files with 13 additions and 4 deletions
|
@ -2573,7 +2573,7 @@ static int builtin_cd( parser_t &parser, wchar_t **argv )
|
||||||
int res=STATUS_BUILTIN_OK;
|
int res=STATUS_BUILTIN_OK;
|
||||||
|
|
||||||
|
|
||||||
if( argv[1] == 0 )
|
if (argv[1] == NULL)
|
||||||
{
|
{
|
||||||
dir_in = env_get_string( L"HOME" );
|
dir_in = env_get_string( L"HOME" );
|
||||||
if( dir_in.missing_or_empty() )
|
if( dir_in.missing_or_empty() )
|
||||||
|
|
11
path.cpp
11
path.cpp
|
@ -292,6 +292,13 @@ bool path_get_cdpath_string(const wcstring &dir_str, wcstring &result, const env
|
||||||
|
|
||||||
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);
|
wcstokenizer tokenizer(path, ARRAY_SEP_STR);
|
||||||
wcstring next_path;
|
wcstring next_path;
|
||||||
while (tokenizer.next(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 *state;
|
||||||
wchar_t *whole_path;
|
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() );
|
path_cpy = wcsdup( path.c_str() );
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue