From e10f75483fcbf44a813e9fd446529bccc1e52eee Mon Sep 17 00:00:00 2001 From: liljencrantz Date: Thu, 17 Jan 2008 08:07:38 +1000 Subject: Fix minor bug, PWD was incorrectly set on startup darcs-hash:20080116220738-75c98-2b7c886629857540efee8f1cab9da0aa9ed8f76d.gz --- env.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'env.c') 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() -- cgit v1.2.3