Minor mod ... hack for compatibility.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@14321 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
CaS 2002-08-23 20:57:42 +00:00
parent ec64ebf9d6
commit 1d13da9cdf
2 changed files with 15 additions and 3 deletions

View file

@ -1,3 +1,8 @@
2002-08-23 Richard Frith-Macdonald <rfm@gnu.org>
* 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 <rfm@gnu.org> 2002-08-22 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSFileManager.m: Fix typo ... missing closing brace under * Source/NSFileManager.m: Fix typo ... missing closing brace under

View file

@ -577,7 +577,7 @@ static void unescape(const char *from, char * to)
} }
/** <init /> /** <init />
* 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.<br /> * may be nil, but aUrlString must be non-nil.<br />
* If the string cannot be parsed the method returns 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. *ptr = '\0'; // Terminate it.
end = &ptr[1]; end = &ptr[1];
/* /*
* Standardise upprcase to lower. * Standardise uppercase to lower.
*/ */
while (--ptr > start) 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 * 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 * leading slash ('/') character (wheras the path part of a URL strictly
* should not) and the interpretation of non-ascii character is (strictly * should not) and the interpretation of non-ascii character is (strictly
* speaking) undefined. * speaking) undefined.<br />
* Also, this breaks strict conformance in that a URL of file scheme is
* treated as having a path (contrary to RFCs)
*/ */
- (NSString*) path - (NSString*) path
{ {
@ -1229,6 +1231,11 @@ static void unescape(const char *from, char * to)
unescape(buf, buf); unescape(buf, buf);
path = [NSString stringWithUTF8String: 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; return path;
} }