mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-21 20:51:52 +00:00
If we don't have a home directory, we can't expand a '~' in a path.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39926 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
23f92b6399
commit
96d39e79bc
2 changed files with 9 additions and 6 deletions
|
@ -4659,8 +4659,8 @@ static NSFileManager *fm = nil;
|
|||
}
|
||||
|
||||
firstSlashRange = [self rangeOfCharacterFromSet: pathSeps()
|
||||
options: NSLiteralSearch
|
||||
range: ((NSRange){0, length})];
|
||||
options: NSLiteralSearch
|
||||
range: ((NSRange){0, length})];
|
||||
if (firstSlashRange.length == 0)
|
||||
{
|
||||
firstSlashRange.location = length;
|
||||
|
@ -4692,12 +4692,12 @@ static NSFileManager *fm = nil;
|
|||
firstSlashRange.location = [self length];
|
||||
}
|
||||
uname = [self substringWithRange: ((NSRange){1, userNameLen})];
|
||||
homedir = NSHomeDirectoryForUser (uname);
|
||||
homedir = NSHomeDirectoryForUser(uname);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* It is of the form `~/blah/...' or is '~' */
|
||||
homedir = NSHomeDirectory ();
|
||||
homedir = NSHomeDirectory();
|
||||
}
|
||||
|
||||
if (homedir != nil)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue