Escape characters in path when building URL

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23036 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2006-06-06 05:29:12 +00:00
parent 087e9db5e6
commit b2724f38c6
2 changed files with 10 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2006-06-06 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSURL.m: ([initWithScheme:host:path:]) escape characters in
path as required.
2006-06-04 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSIndexPath.m:

View file

@ -518,7 +518,9 @@ static unsigned urlAlign;
/**
* Initialise by building a URL string from the supplied parameters
* and calling -initWithString:relativeToURL:
* and calling -initWithString:relativeToURL:<br />
* This method adds percent escapes to aPath if it contains characters
* which need ascaping.
*/
- (id) initWithScheme: (NSString*)aScheme
host: (NSString*)aHost
@ -526,6 +528,8 @@ static unsigned urlAlign;
{
NSString *aUrlString = [NSString alloc];
aPath
= [aPath stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
if ([aHost length] > 0)
{
if ([aPath length] > 0)