aboutsummaryrefslogtreecommitdiffhomepage
path: root/env.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 /env.c
parent1a66fc4c5de8a6d8558193dbf6ca061839baf562 (diff)
Fix minor bug, PWD was incorrectly set on startup
darcs-hash:20080116220738-75c98-2b7c886629857540efee8f1cab9da0aa9ed8f76d.gz
Diffstat (limited to 'env.c')
-rw-r--r--env.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/env.c b/env.c
index c0f1215b..32125185 100644
--- a/env.c
+++ b/env.c
@@ -480,6 +480,18 @@ static void setup_path()
al_destroy( &l );
}
+int env_set_pwd()
+{
+ wchar_t dir_path[4096];
+ wchar_t *res = wgetcwd( dir_path, 4096 );
+ if( !res )
+ {
+ return 0;
+ }
+ env_set( L"PWD", dir_path, ENV_EXPORT | ENV_GLOBAL );
+ return 1;
+}
+
/**
Set up default values for various variables if not defined.
*/
@@ -505,6 +517,8 @@ static void env_set_defaults()
free( unam_narrow );
}
+ env_set_pwd();
+
}
void env_init()