From 25b8816b4db3ac91d1ed333f84f1cfc23724f838 Mon Sep 17 00:00:00 2001 From: rfm Date: Fri, 30 Jan 2009 20:08:42 +0000 Subject: [PATCH] Macos compatibility fix git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@27736 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 4 ++++ Source/NSURL.m | 11 ++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index f82c1fedb..0d5783d36 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-01-30 Richard Frith-Macdonald + + * Source/NSURL.m: For file URL, make relative path absolute. + 2009-01-30 Richard Frith-Macdonald * Documentation/readme.texi: diff --git a/Source/NSURL.m b/Source/NSURL.m index 748ea919e..d7c24684b 100644 --- a/Source/NSURL.m +++ b/Source/NSURL.m @@ -620,10 +620,15 @@ static unsigned urlAlign; */ - (id) initFileURLWithPath: (NSString*)aPath { - BOOL flag = NO; + NSFileManager *mgr = [NSFileManager defaultManager]; + BOOL flag = NO; - if ([[NSFileManager defaultManager] fileExistsAtPath: aPath - isDirectory: &flag] == YES) + if ([aPath isAbsolutePath] == NO) + { + aPath = [[mgr currentDirectoryPath] + stringByAppendingPathComponent: aPath]; + } + if ([mgr fileExistsAtPath: aPath isDirectory: &flag] == YES) { if ([aPath isAbsolutePath] == NO) {