Simplify code by using stringByDeletingLastPathComponent

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@39521 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Riccardo Mottola 2016-03-10 17:42:21 +00:00
parent c51df6b189
commit e00f1870c6
2 changed files with 6 additions and 7 deletions

View file

@ -1,3 +1,8 @@
2016-03-10 Riccardo Mottola <rm@gnu.org>
* Source/NSWorkspace.m
Simplify code by using stringByDeletingLastPathComponent
2016-03-10 Riccardo Mottola <rm@gnu.org>
* Source/NSWorkspace.m

View file

@ -1394,13 +1394,7 @@ inFileViewerRootedAtPath: (NSString*)rootFullpath
*/
if ([fileType isEqual: NSFileTypeSymbolicLink] == YES)
{
NSString *linkPath;
linkPath = [mgr pathContentOfSymbolicLinkAtPath:fullPath];
if ([linkPath isAbsolutePath])
fullPath = linkPath;
else
fullPath = [[[fullPath stringByDeletingLastPathComponent] stringByAppendingPathComponent:linkPath] stringByStandardizingPath];
fullPath = [fullPath stringByResolvingSymlinksInPath];
/* now we reget the target attributes */
attributes = [mgr fileAttributesAtPath: fullPath traverseLink: NO];