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) {