diff --git a/ChangeLog b/ChangeLog index a47c1705e..fd33ccb12 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-01-25 Richard Frith-Macdonald + + * Source/NSURL.m: Compatibility tweaks for a few MacOS-X oddities... + Initialise file URLs with a host of 'localhost' even though they + should really have none. + Return paths without a trailing slash, even when they were set + with one. + 2009-01-25 Richard Frith-Macdonald * Source/NSString.m: Fix for bug #25400 diff --git a/Source/NSURL.m b/Source/NSURL.m index 714dafc6e..748ea919e 100644 --- a/Source/NSURL.m +++ b/Source/NSURL.m @@ -635,7 +635,7 @@ static unsigned urlAlign; } } self = [self initWithScheme: NSURLFileScheme - host: nil + host: @"localhost" path: aPath]; return self; } @@ -1436,6 +1436,13 @@ static unsigned urlAlign; } unescape(buf, buf); + /* Remove any trailing '/' from the path for MacOS-X compatibility. + */ + tmp = buf + strlen(buf) - 1; + if (tmp > buf && *tmp == '/') + { + *tmp = '\0'; + } path = [NSString stringWithUTF8String: buf]; } return path;