Restore some reverted changes. Tidy up a bit

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@22021 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
CaS 2005-11-16 11:44:44 +00:00
parent 15de84b232
commit 398d3a9e77
5 changed files with 150 additions and 134 deletions

View file

@ -627,27 +627,36 @@ static BOOL setSharedDefaults = NO; /* Flag to prevent infinite recursion */
#endif
if (currLang == nil)
{
const char *env_list;
NSString *env;
env_list = getenv("LANGUAGES");
if (env_list != 0)
env = [[[NSProcessInfo processInfo] environment]
objectForKey: @"LANGUAGES"];
if (env != nil)
{
env = [NSStringClass stringWithCString: env_list];
currLang = [env componentsSeparatedByString: @";"];
}
}
if (currLang != nil)
{
if ([currLang containsObject: @""] == YES)
{
NSMutableArray *a = [currLang mutableCopy];
NSMutableArray *a = [currLang mutableCopy];
unsigned c = [a count];
[a removeObject: @""];
currLang = (NSArray*)AUTORELEASE(a);
while (c-- > 0)
{
NSString *s = [[a objectAtIndex: c] stringByTrimmingSpaces];
if ([s length] == 0)
{
[a removeObjectAtIndex: c];
}
else
{
[a replaceObjectAtIndex: c withObject: s];
}
}
[userLanguages addObjectsFromArray: currLang];
[userLanguages addObjectsFromArray: a];
RELEASE(a);
}
/* Check if "English" is included. We do this to make sure all the