Tweak comments and indentation.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@20919 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
CaS 2005-03-17 15:27:52 +00:00
parent 669383fbc7
commit 51376a9b9e

View file

@ -202,8 +202,8 @@ static NSString *setUserGNUstepPath(NSString *userName,
static NSDictionary *GSReadStepConfFile(NSString *name); static NSDictionary *GSReadStepConfFile(NSString *name);
void InitialisePathUtilities(void); static void InitialisePathUtilities(void);
void ShutdownPathUtilities(void); static void ShutdownPathUtilities(void);
/* make sure that the path 'path' is in internal format (unix-style) */ /* make sure that the path 'path' is in internal format (unix-style) */
static inline NSString* static inline NSString*
@ -376,7 +376,7 @@ static NSString *setUserGNUstepPath(NSString *userName,
} }
/* Initialise all things required by this module */ /* Initialise all things required by this module */
void InitialisePathUtilities(void) static void InitialisePathUtilities(void)
{ {
NSDictionary *env; NSDictionary *env;
@ -486,16 +486,18 @@ void InitialisePathUtilities(void)
#endif /* OPTION_PLATFORM SUPPORT */ #endif /* OPTION_PLATFORM SUPPORT */
} }
} }
#endif /* defined(__WIN32__) else */ #endif
/* Omitting the following line would mean system admins could force /* System admins may force the user and defaults paths by
the user and defaults paths by leaving USER_GNUSTEP_RC blank. */ * setting USER_GNUSTEP_RC to be an empty string.
* If they simply don't define it at all, we assign a default
* value here.
*/
TEST_ASSIGN(gnustepRcFileName, DEFAULT_STEPRC_FILE); TEST_ASSIGN(gnustepRcFileName, DEFAULT_STEPRC_FILE);
/* If the user has an rc file we need to source it */ /* If the user has an rc file we need to source it */
gnustepUserRoot = setUserGNUstepPath(NSUserName(), gnustepUserRoot = setUserGNUstepPath(NSUserName(),
&gnustepDefaultsPath, &gnustepDefaultsPath, &gnustepUserPath);
&gnustepUserPath);
/* Make sure that they're in path internal format */ /* Make sure that they're in path internal format */
internalizePath(gnustepSystemRoot); internalizePath(gnustepSystemRoot);
@ -550,7 +552,7 @@ void InitialisePathUtilities(void)
/* /*
* Close down and release all things allocated. * Close down and release all things allocated.
*/ */
void ShutdownPathUtilities(void) static void ShutdownPathUtilities(void)
{ {
TEST_RELEASE(gnustepSystemRoot); TEST_RELEASE(gnustepSystemRoot);
TEST_RELEASE(gnustepNetworkRoot); TEST_RELEASE(gnustepNetworkRoot);
@ -839,11 +841,14 @@ GSDefaultsRootForUser(NSString *userName)
NSString *defaultsPath = nil; NSString *defaultsPath = nil;
NSString *userPath = nil; NSString *userPath = nil;
NSCParameterAssert([userName length] > 0); if ([userName length] == 0)
{
userName = NSUserName();
}
if (gnustepSystemRoot == nil) if (gnustepSystemRoot == nil)
{
InitialisePathUtilities(); InitialisePathUtilities();
}
if ([userName isEqual: NSUserName()]) if ([userName isEqual: NSUserName()])
{ {
home = gnustepUserRoot; home = gnustepUserRoot;
@ -1172,8 +1177,9 @@ NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory directoryKey,
unsigned count; unsigned count;
if (gnustepSystemRoot == nil) if (gnustepSystemRoot == nil)
{
InitialisePathUtilities(); InitialisePathUtilities();
}
NSCAssert(gnustepSystemRoot!=nil,@"Path utilities without initialisation!"); NSCAssert(gnustepSystemRoot!=nil,@"Path utilities without initialisation!");
/* /*