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

@ -2,6 +2,10 @@
* Source/NSAffineTransform.m:
Fix decoding of keyed archive containing identity transform.
* Source/NSString.m:
* Tests/base/NSString/tilde.m:
Fix to standardize string if necessary to determine whether it has
the home directory as a prefix.
2013-03-23 Fred Kiefer <FredKiefer@gmx.de>

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 @"~";