mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +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()];
|
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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue