diff --git a/Tools/gopen.m b/Tools/gopen.m index 3a635adaa..6bbdec407 100644 --- a/Tools/gopen.m +++ b/Tools/gopen.m @@ -1,9 +1,10 @@ /* This tool opens the appropriate application from the command line based on what type of file is being accessed. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2025 Software Foundation, Inc. - Written by: Gregory Casamento + Written by: Gregory Casamento + Riccardo Mottola Created: November 2001 This file is part of the GNUstep Project @@ -45,11 +46,12 @@ static NSString* absolutePath(NSFileManager *fm, NSString *path) { + if (nil == path || [path length] == 0) + return path; + + if (![path isAbsolutePath]) + path = [[fm currentDirectoryPath] stringByAppendingPathComponent: path] ; path = [path stringByStandardizingPath]; - if ([path isAbsolutePath] == NO) - { - path = [[fm currentDirectoryPath] stringByAppendingPathComponent: path]; - } return path; }