OSX compatibility tweaks

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@36430 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2013-03-25 14:15:23 +00:00
parent 22e037c478
commit 8ab462066b
2 changed files with 16 additions and 1 deletions

View file

@ -4209,10 +4209,21 @@ static NSFileManager *fm = nil;
{
NSString *homedir = NSHomeDirectory ();
if (![self hasPrefix: homedir])
if (YES == [self hasPrefix: @"~"])
{
return IMMUTABLE(self);
}
if (NO == [self hasPrefix: homedir])
{
/* OSX compatibility ... we clean up the path to try to get a
* home directory we can abbreviate.
*/
self = [self stringByStandardizingPath];
if (NO == [self hasPrefix: homedir])
{
return IMMUTABLE(self);
}
}
if ([self length] == [homedir length])
{
return @"~";