aboutsummaryrefslogtreecommitdiffhomepage
path: root/path.cpp
diff options
context:
space:
mode:
authorGravatar Siteshwar Vashisht <siteshwar@gmail.com>2012-02-09 01:18:51 +0530
committerGravatar Siteshwar Vashisht <siteshwar@gmail.com>2012-02-09 01:18:51 +0530
commitbc8a28838640ad6d816641fa108f1e40edfe15bd (patch)
treec4968241e91fa461250c8d8d816b8de3561f00a5 /path.cpp
parent3dc56de0ae42b40104337803c392f506491b30d6 (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.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/path.cpp b/path.cpp
index 930f8563..7b56388a 100644
--- a/path.cpp
+++ b/path.cpp
@@ -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;