([NSUserDefaults -initWithUser:]): Don't try to append to a immutable

string!


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1904 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
mccallum 1996-10-31 19:04:41 +00:00
parent 25e416ece3
commit 3490aab20e

View file

@ -181,20 +181,20 @@ static NSMutableString *processName = nil;
return [self initWithUser:NSUserName()]; return [self initWithUser:NSUserName()];
} }
/* Initializes defaults for the specified user calling initWithFile:. */
- (id)initWithUser:(NSString *)userName - (id)initWithUser:(NSString *)userName
/* Initializes defaults for the specified user calling initWithFile:. */
{ {
NSMutableString* userHome = NSHomeDirectoryForUser(userName); NSString* userHome = NSHomeDirectoryForUser(userName);
NSString *filename;
// Either userName is empty or it's wrong // Either userName is empty or it's wrong
if (!userHome) if (!userHome)
{ {
[self release]; [self release]; /* xxx really? -mccallum. */
return nil; return nil;
} }
[userHome appendString:GNU_UserDefaultsDatabese]; filename = [userHome stringByAppendingString: GNU_UserDefaultsDatabese];
return [self initWithContentsOfFile: filename];
return [self initWithContentsOfFile:userHome];
} }
- (id)initWithContentsOfFile:(NSString *)path - (id)initWithContentsOfFile:(NSString *)path