mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
([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:
parent
25e416ece3
commit
3490aab20e
1 changed files with 6 additions and 6 deletions
|
@ -181,20 +181,20 @@ static NSMutableString *processName = nil;
|
|||
return [self initWithUser:NSUserName()];
|
||||
}
|
||||
|
||||
/* Initializes defaults for the specified user calling initWithFile:. */
|
||||
- (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
|
||||
if (!userHome)
|
||||
{
|
||||
[self release];
|
||||
[self release]; /* xxx really? -mccallum. */
|
||||
return nil;
|
||||
}
|
||||
[userHome appendString:GNU_UserDefaultsDatabese];
|
||||
|
||||
return [self initWithContentsOfFile:userHome];
|
||||
filename = [userHome stringByAppendingString: GNU_UserDefaultsDatabese];
|
||||
return [self initWithContentsOfFile: filename];
|
||||
}
|
||||
|
||||
- (id)initWithContentsOfFile:(NSString *)path
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue