Not sure this is a good idea ... but allow the real environment to be

overridden when NSProcessInfo is initialised.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@22142 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
CaS 2005-12-05 08:37:16 +00:00
parent 92645ed803
commit 54f46448cc
2 changed files with 44 additions and 33 deletions

View file

@ -1,3 +1,9 @@
2005-12-05 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSProcessInfo.m: Allow
([+initializeWithArguments:count:environment:]) to override the real
environment on mingw32.
2005-12-02 Richard Frith-Macdonald <rfm@gnu.org>
* configure.ac: Fix bug configuring whether GNUstep.conf can be

View file

@ -290,6 +290,8 @@ _gnu_process_args(int argc, char *argv[], char *env[])
NSMutableArray *values = [NSMutableArray new];
#if defined(__MINGW32__)
if (fallbackInitialisation == NO)
{
unichar *base;
base = GetEnvironmentStringsW();
@ -332,6 +334,7 @@ _gnu_process_args(int argc, char *argv[], char *env[])
FreeEnvironmentStringsW(base);
env = 0; // Suppress standard code.
}
}
#endif
if (env != 0)
{
@ -1055,6 +1058,7 @@ int main(int argc, char *argv[], char *env[])
@implementation NSProcessInfo (GNUstep)
static BOOL debugTemporarilyDisabled = NO;
static BOOL fallbackInitialisation = NO;
/**
* Fallback method. The developer must call this method to initialize
@ -1068,6 +1072,7 @@ static BOOL debugTemporarilyDisabled = NO;
environment: (char**)env
{
[gnustep_global_lock lock];
fallbackInitialisation = YES;
_gnu_process_args(argc, argv, env);
[gnustep_global_lock unlock];
}