diff --git a/ChangeLog b/ChangeLog index 3fa59e4dd..f3558f88a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-08-23 Richard Frith-Macdonald + + * Source/NSURL.m: Hack for compatibility with MacOS-X in returning + path of a file URL ... the RFC says we shouldn't. + 2002-08-22 Richard Frith-Macdonald * Source/NSFileManager.m: Fix typo ... missing closing brace under diff --git a/Source/NSURL.m b/Source/NSURL.m index 44c2d24c5..59943be69 100644 --- a/Source/NSURL.m +++ b/Source/NSURL.m @@ -577,7 +577,7 @@ static void unescape(const char *from, char * to) } /** - * Iinitialised susing aUrlString and aBaseUrl. The value of aBaseUrl + * Initialised using aUrlString and aBaseUrl. The value of aBaseUrl * may be nil, but aUrlString must be non-nil.
* If the string cannot be parsed the method returns nil. */ @@ -628,7 +628,7 @@ static void unescape(const char *from, char * to) *ptr = '\0'; // Terminate it. end = &ptr[1]; /* - * Standardise upprcase to lower. + * Standardise uppercase to lower. */ while (--ptr > start) { @@ -1175,7 +1175,9 @@ static void unescape(const char *from, char * to) * NB. This does not conform strictly to the RFCs, in that it includes a * leading slash ('/') character (wheras the path part of a URL strictly * should not) and the interpretation of non-ascii character is (strictly - * speaking) undefined. + * speaking) undefined.
+ * Also, this breaks strict conformance in that a URL of file scheme is + * treated as having a path (contrary to RFCs) */ - (NSString*) path { @@ -1229,6 +1231,11 @@ static void unescape(const char *from, char * to) unescape(buf, buf); path = [NSString stringWithUTF8String: buf]; } + else if (myData->scheme != 0 && myData->path != 0 + && strcmp(myData->scheme, "file") == 0) + { + path = [NSString stringWithUTF8String: myData->path]; + } return path; }