mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
OSX like behaviour for NSURLQueryItem initialisers
This commit is contained in:
parent
ce1c03f6da
commit
2a547271ad
1 changed files with 18 additions and 9 deletions
|
@ -2116,17 +2116,26 @@ GS_PRIVATE_INTERNAL(NSURLQueryItem)
|
|||
return AUTORELEASE(newQueryItem);
|
||||
}
|
||||
|
||||
- (instancetype)initWithName:(NSString *)name
|
||||
value:(NSString *)value
|
||||
- (instancetype) init
|
||||
{
|
||||
self = [super init];
|
||||
if (self != nil)
|
||||
{
|
||||
GS_CREATE_INTERNAL(NSURLQueryItem);
|
||||
|
||||
ASSIGNCOPY(internal->_name, name);
|
||||
ASSIGNCOPY(internal->_value, value);
|
||||
}
|
||||
if(self != nil)
|
||||
{
|
||||
GS_CREATE_INTERNAL(NSURLQueryItem);
|
||||
ASSIGN(internal->_name, @""); //OSX behaviour is to set an empty string for the name property
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (instancetype)initWithName:(NSString *)name
|
||||
value:(NSString *)value
|
||||
{
|
||||
self = [self init];
|
||||
if(self != nil)
|
||||
{
|
||||
if(name)ASSIGNCOPY(internal->_name, name);
|
||||
ASSIGNCOPY(internal->_value, value);
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue