Fix minor bug, PWD was incorrectly set on startup

darcs-hash:20080116220738-75c98-2b7c886629857540efee8f1cab9da0aa9ed8f76d.gz
This commit is contained in:
liljencrantz
2008-01-17 08:07:38 +10:00
parent 1a66fc4c5d
commit e10f75483f
3 changed files with 22 additions and 18 deletions

14
env.c
View File

@@ -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()