mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
OSX compatibility fixes for zero width space character and initialising an NSURL
with bad strings.
This commit is contained in:
parent
0e12e226c9
commit
7045f84acc
21 changed files with 31196 additions and 30499 deletions
File diff suppressed because it is too large
Load diff
|
@ -811,6 +811,11 @@ static NSUInteger urlAlign;
|
|||
*/
|
||||
static const char *filepath = ";/?:@&=+$,[]#";
|
||||
|
||||
if (nil == aUrlString)
|
||||
{
|
||||
RELEASE(self);
|
||||
return nil; // OSX behavior is to give up.
|
||||
}
|
||||
if ([aUrlString isKindOfClass: [NSString class]] == NO)
|
||||
{
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
|
@ -843,9 +848,20 @@ static NSUInteger urlAlign;
|
|||
buf = _data = (parsedURL*)NSZoneMalloc(NSDefaultMallocZone(), size);
|
||||
memset(buf, '\0', size);
|
||||
start = end = ptr = (char*)&buf[1];
|
||||
[_urlString getCString: start
|
||||
maxLength: size
|
||||
encoding: NSASCIIStringEncoding];
|
||||
NS_DURING
|
||||
{
|
||||
[_urlString getCString: start
|
||||
maxLength: size
|
||||
encoding: NSASCIIStringEncoding];
|
||||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
/* OSX behavior when given non-ascii text is to return nil.
|
||||
*/
|
||||
RELEASE(self);
|
||||
return nil;
|
||||
}
|
||||
NS_ENDHANDLER
|
||||
|
||||
/*
|
||||
* Parse the scheme if possible.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue