Enahnce reading of .GNUsteprc

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@12942 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2002-03-01 16:06:38 +00:00
parent 7f17be9de5
commit 1a1e80b60f
2 changed files with 21 additions and 0 deletions

View file

@ -466,6 +466,22 @@ userDirectory(NSString *name, BOOL defaults)
home = NSHomeDirectoryForUser(name);
file = [home stringByAppendingPathComponent: @".GNUsteprc"];
manager = [NSFileManager defaultManager];
/*
* If there is no per-user startup file, look in the one in the
* configured system root directory. NB. Don't use the environment
* variable ... that could have been changed!
*/
if ([manager isReadableFileAtPath: file] == NO)
{
NSString *root;
root = [NSString stringWithCString: stringify(GNUSTEP_INSTALL_PREFIX)];
#if defined (__MINGW32__)
root = [GSStringFromWin32EnvironmentVariable("SystemDrive")
stringByAppendingString: gnustep_system_root];
#endif
file = [root stringByAppendingPathComponent: @".GNUsteprc"];
}
if ([manager isReadableFileAtPath: file] == YES)
{
NSArray *lines;