mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 01:00:38 +00:00
Fix standardizing absolute paths: first check for them, then add CWD
then standardize the path. As we are, add a nil/empty string check for path.
This commit is contained in:
parent
e3da52aae3
commit
a4da1a1b5a
1 changed files with 8 additions and 6 deletions
|
@ -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 <greg_casamento@yahoo.com>
|
||||
Written by: Gregory Casamento <greg.casamento@gmail.com>
|
||||
Riccardo Mottola <rm@gnu.org>
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue