Fix for GSSetUserName

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@22002 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2005-11-14 11:45:43 +00:00
parent f94cee1583
commit 25fb578f1c
2 changed files with 8 additions and 9 deletions

View file

@ -3,6 +3,8 @@
* Source/win32/GSFileHandleWin32.m: Move mingw32 implementation of
file handle code here.
* Source/GSFileHandle.m: Remove mingw32 code.
* Source/NSPathUtilitires.m: Fix handling of user config file for
when the user name is changed.
2005-11-12 Richard Frith-Macdonald <rfm@gnu.org>

View file

@ -134,7 +134,6 @@ static NSString *gnustepSystemRoot = nil; /* GNUSTEP_SYSTEM_ROOT path */
static NSString *gnustepUserDir = nil;
static NSString *gnustepUserHome = nil;
static NSString *gnustepUserConfigFile = nil;
static NSString *gnustepUserDefaultsDir = nil;
static NSString *theUserName = nil; /* The user's login name */
@ -175,7 +174,7 @@ static NSString *localLibs = nil;
/* Internal function prototypes. */
/* ============================= */
static NSDictionary* GNUstepConfig(void);
NSDictionary* GNUstepConfig(void);
static BOOL ParseConfigurationFile(NSString *name, NSMutableDictionary *dict);
@ -353,7 +352,7 @@ static void ExtractValuesFromConfig(NSDictionary *config)
/*
* Function to return the system-wide configuration
*/
static NSDictionary*
NSDictionary*
GNUstepConfig(void)
{
static NSDictionary *config = nil;
@ -417,8 +416,6 @@ GNUstepConfig(void)
}
config = [conf copy];
DESTROY(conf);
gnustepUserConfigFile
= [config objectForKey: @"GNUSTEP_USER_CONFIG_FILE"];
}
NS_HANDLER
{
@ -445,14 +442,15 @@ GNUstepUserConfig(NSString *name)
NSString *home;
conf = [GNUstepConfig() mutableCopy];
file = gnustepUserConfigFile;
file = RETAIN([conf objectForKey: @"GNUSTEP_USER_CONFIG_FILE"]);
home = NSHomeDirectoryForUser(name);
ParseConfigurationFile([home stringByAppendingPathComponent: file], conf);
/*
* We don't let the user config file override the GNUSTEP_USER_CONFIG_FILE
* variable ... that would be silly/pointless.
*/
[conf setObject: gnustepUserConfigFile forKey: @"GNUSTEP_USER_CONFIG_FILE"];
[conf setObject: file forKey: @"GNUSTEP_USER_CONFIG_FILE"];
RELEASE(file);
return AUTORELEASE(conf);
}
@ -490,7 +488,7 @@ static void InitialisePathUtilities(void)
NSString *file;
file = [gnustepUserHome stringByAppendingPathComponent:
gnustepUserConfigFile];
[userConfig objectForKey: @"GNUSTEP_USER_CONFIG_FILE"]];
ParseConfigurationFile(file, userConfig);
}
ExtractValuesFromConfig(userConfig);
@ -519,7 +517,6 @@ static void ShutdownPathUtilities(void)
DESTROY(gnustepUserRoot);
DESTROY(gnustepUserHome);
DESTROY(gnustepUserConfigFile);
DESTROY(gnustepUserDefaultsDir);
#ifdef OPTION_PLATFORM_SUPPORT