diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2012-05-09 02:33:42 -0700 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2012-05-09 02:33:42 -0700 |
commit | 9bcc7df96f2e40e54fb1cebdb6df5de4139b0ed9 (patch) | |
tree | 20445bda332b490515445acee5a7c79a45ed1db8 /builtin.cpp | |
parent | 4bd63020ca897b4b65d74469a0036451a2e23fa4 (diff) |
Lots of modernization changed
Removed wcsdupcat
Diffstat (limited to 'builtin.cpp')
-rw-r--r-- | builtin.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/builtin.cpp b/builtin.cpp index a926f436..c0372812 100644 --- a/builtin.cpp +++ b/builtin.cpp @@ -2569,7 +2569,7 @@ static int builtin_exit( parser_t &parser, wchar_t **argv ) static int builtin_cd( parser_t &parser, wchar_t **argv ) { env_var_t dir_in; - wchar_t *dir; + wchar_t *dir = NULL; int res=STATUS_BUILTIN_OK; @@ -2583,10 +2583,13 @@ static int builtin_cd( parser_t &parser, wchar_t **argv ) argv[0] ); } } - else + else { dir_in = argv[1]; + } - dir = path_allocate_cdpath( dir_in.missing() ? NULL : dir_in.c_str() ); + if (! dir_in.missing()) { + dir = path_allocate_cdpath(dir_in); + } if( !dir ) { |