@@ -159,11 +159,11 @@ tmp2++; host = [[OFString alloc] initWithCString: str_c]; pool = [[OFAutoreleasePool alloc] init]; - port_str = [[OFString alloc] initWithCString: tmp2]; + port_str = [OFString stringWithCString: tmp2]; if ([port_str decimalValue] > 65535) @throw [OFInvalidFormatException newWithClass: isa]; @@ -316,21 +316,22 @@ return NO; if (![url->host isEqual: host]) return NO; if (url->port != port) return NO; - if (![url->user isEqual: user]) + if (url->user != user && ![url->user isEqual: user]) return NO; - if (![url->password isEqual: password]) + if (url->password != password && ![url->password isEqual: password]) return NO; if (![url->path isEqual: path]) return NO; - if (![url->parameters isEqual: parameters]) + if (url->parameters != parameters && + ![url->parameters isEqual: parameters]) return NO; - if (![url->query isEqual: query]) + if (url->query != query && ![url->query isEqual: query]) return NO; - if (![url->fragment isEqual: fragment]) + if (url->fragment != fragment && ![url->fragment isEqual: fragment]) return NO; return YES; } @@ -360,19 +361,24 @@ - copy { OFURL *new = [[OFURL alloc] init]; - new->scheme = [scheme copy]; - new->host = [host copy]; - new->port = port; - new->user = [user copy]; - new->password = [password copy]; - new->path = [path copy]; - new->parameters = [parameters copy]; - new->query = [query copy]; - new->fragment = [fragment copy]; + @try { + new->scheme = [scheme copy]; + new->host = [host copy]; + new->port = port; + new->user = [user copy]; + new->password = [password copy]; + new->path = [path copy]; + new->parameters = [parameters copy]; + new->query = [query copy]; + new->fragment = [fragment copy]; + } @catch (id e) { + [new release]; + @throw e; + } return new; } - (OFString*)scheme