mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
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:
parent
7f17be9de5
commit
1a1e80b60f
2 changed files with 21 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue