diff options
author | Siteshwar Vashisht <siteshwar@gmail.com> | 2012-02-09 01:18:51 +0530 |
---|---|---|
committer | Siteshwar Vashisht <siteshwar@gmail.com> | 2012-02-09 01:18:51 +0530 |
commit | bc8a28838640ad6d816641fa108f1e40edfe15bd (patch) | |
tree | c4968241e91fa461250c8d8d816b8de3561f00a5 /path.cpp | |
parent | 3dc56de0ae42b40104337803c392f506491b30d6 (diff) |
Got rid of multiple cd paths, only current directory will be searched while changing directories, implicit cd (entering directory just by typing it's name) is removed.
Diffstat (limited to 'path.cpp')
-rw-r--r-- | path.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
@@ -291,11 +291,8 @@ bool path_get_cdpath_string(const wcstring &dir_str, wcstring &result, const env } else { - const wchar_t *path = vars.get(L"CDPATH"); - if( !path || !wcslen(path) ) - { - path = L"."; - } + + const wchar_t *path = L"."; wcstokenizer tokenizer(path, ARRAY_SEP_STR); wcstring next_path; @@ -340,6 +337,7 @@ bool path_get_cdpath_string(const wcstring &dir_str, wcstring &result, const env return res; } + wchar_t *path_allocate_cdpath( const wchar_t *dir ) { wchar_t *res = 0; @@ -371,9 +369,7 @@ wchar_t *path_allocate_cdpath( const wchar_t *dir ) wchar_t *state; wchar_t *whole_path; - env_var_t path = env_get_string(L"CDPATH"); - if( path.missing_or_empty() ) - path = L"."; + env_var_t path = L"."; nxt_path = path.c_str(); path_cpy = wcsdup( path.c_str() ); @@ -439,6 +435,7 @@ wchar_t *path_allocate_cdpath( const wchar_t *dir ) return res; } + bool path_can_get_cdpath(const wcstring &in) { wchar_t *tmp = path_allocate_cdpath(in.c_str()); bool result = (tmp != NULL); @@ -486,6 +483,7 @@ wchar_t *path_get_config( void *context) } } + bool path_get_config(wcstring &path) { int done = 0; |