Index: Source/NSPathUtilities.m =================================================================== RCS file: /cvsroot/gnustep/gnustep/core/base/Source/NSPathUtilities.m,v retrieving revision 1.39 diff -u -r1.39 NSPathUtilities.m --- Source/NSPathUtilities.m 27 Oct 2005 12:00:38 -0000 1.39 +++ Source/NSPathUtilities.m 28 Oct 2005 16:48:49 -0000 @@ -366,15 +366,36 @@ /* * Function to return the system-wide configuration */ +static NSDictionary *systemGNUStepConfig = nil; + +void setGNUstepConfig(NSDictionary*conf) +{ + [gnustep_global_lock lock]; + NS_DURING + if ([conf objectForKey: @"GNUSTEP_USER_CONFIG_FILE"] == nil) + { + conf = [[conf mutableCopy] autorelease]; + [(NSMutableDictionary*)conf setObject: @".GNUstep.conf" + forKey: @"GNUSTEP_USER_CONFIG_FILE"]; + } + systemGNUStepConfig = [conf copy]; + gnustepUserConfigFile + = [systemGNUStepConfig objectForKey: @"GNUSTEP_USER_CONFIG_FILE"]; + NS_HANDLER + [gnustep_global_lock unlock]; + systemGNUStepConfig = nil; + [localException raise]; + NS_ENDHANDLER + [gnustep_global_lock unlock]; +} + static NSDictionary* GNUstepConfig(void) { - static NSDictionary *config = nil; - - if (config == nil) + if (systemGNUStepConfig == nil) { [gnustep_global_lock lock]; - if (config == nil) + if (systemGNUStepConfig == nil) { NSMutableDictionary *conf = nil; @@ -428,15 +449,15 @@ STRINGIFY(GNUSTEP_USER_CONFIG_FILE)]; [conf setObject: tmp forKey: @"GNUSTEP_USER_CONFIG_FILE"]; } - config = [conf copy]; + systemGNUStepConfig = [conf copy]; DESTROY(conf); gnustepUserConfigFile - = [config objectForKey: @"GNUSTEP_USER_CONFIG_FILE"]; + = [systemGNUStepConfig objectForKey: @"GNUSTEP_USER_CONFIG_FILE"]; } NS_HANDLER { [gnustep_global_lock unlock]; - config = nil; + systemGNUStepConfig = nil; DESTROY(conf); [localException raise]; } @@ -444,7 +465,7 @@ } [gnustep_global_lock unlock]; } - return config; + return systemGNUStepConfig; } /* @@ -1029,7 +1050,10 @@ defaultsDir = @GNUSTEP_TARGET_USER_DEFAULTS_DIR; } } - home = [home stringByAppendingPathComponent: defaultsDir]; + if ([defaultsDir rangeOfString: @":REGISTRY:"].length > 0) + home = defaultsDir; + else + home = [home stringByAppendingPathComponent: defaultsDir]; return home; }