aboutsummaryrefslogtreecommitdiffhomepage
path: root/builtin.c
diff options
context:
space:
mode:
authorGravatar liljencrantz <liljencrantz@gmail.com>2008-01-17 08:07:38 +1000
committerGravatar liljencrantz <liljencrantz@gmail.com>2008-01-17 08:07:38 +1000
commite10f75483fcbf44a813e9fd446529bccc1e52eee (patch)
treebf7603d54f429b223041f25d2e2a893eccf73e62 /builtin.c
parent1a66fc4c5de8a6d8558193dbf6ca061839baf562 (diff)
Fix minor bug, PWD was incorrectly set on startup
darcs-hash:20080116220738-75c98-2b7c886629857540efee8f1cab9da0aa9ed8f76d.gz
Diffstat (limited to 'builtin.c')
-rw-r--r--builtin.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/builtin.c b/builtin.c
index 37b4fadc..ba6f3a00 100644
--- a/builtin.c
+++ b/builtin.c
@@ -2555,23 +2555,6 @@ static int builtin_exit( wchar_t **argv )
}
/**
- Helper function for builtin_cd, used for seting the current working
- directory
-*/
-static int set_pwd( wchar_t *env)
-{
- wchar_t dir_path[4096];
- wchar_t *res = wgetcwd( dir_path, 4096 );
- if( !res )
- {
- builtin_wperror( L"wgetcwd" );
- return STATUS_BUILTIN_OK;
- }
- env_set( env, dir_path, ENV_EXPORT | ENV_GLOBAL );
- return 1;
-}
-
-/**
The cd builtin. Changes the current directory to the one specified
or to $HOME if none is specified. The directory can be relative to
any directory in the CDPATH variable.
@@ -2674,7 +2657,7 @@ static int builtin_cd( wchar_t **argv )
res = 1;
}
- else if( !set_pwd(L"PWD") )
+ else if( !env_set_pwd(L"PWD") )
{
res=1;
sb_printf( sb_err, _( L"%ls: Could not set PWD variable\n" ), argv[0] );