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:
Richard Frith-MacDonald 2016-06-26 12:04:23 +00:00
parent 23f92b6399
commit 96d39e79bc
2 changed files with 9 additions and 6 deletions

View file

@ -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)