Compatibility fix.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@15609 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2003-01-16 15:09:18 +00:00
parent 9d1a33f8d1
commit 590043c595
2 changed files with 20 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2003-01-16 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSURL.m: Support MacOS-X style initialisation using a path
with a leading slash.
2003-01-09 Richard Frith-Macdonald <rfm@gnu.org>
* Source/Additions/GSCategories.m: Additional ([weekOfYear]) method

View file

@ -528,8 +528,21 @@ static void unescape(const char *from, char * to)
{
if ([aPath length] > 0)
{
aUrlString = [aUrlString initWithFormat: @"%@://%@/%@",
aScheme, aHost, aPath];
/*
* For MacOS-X compatibility, assume a path component with
* a leading slash is intended to have that slash separating
* the host from the path as specified in the RFC1738
*/
if ([aPath hasPrefix: @"/"] == YES)
{
aUrlString = [aUrlString initWithFormat: @"%@://%@%@",
aScheme, aHost, aPath];
}
else
{
aUrlString = [aUrlString initWithFormat: @"%@://%@/%@",
aScheme, aHost, aPath];
}
}
else
{