Index: src/OFURL.m ================================================================== --- src/OFURL.m +++ src/OFURL.m @@ -341,21 +341,25 @@ return NO; if (![otherURL->host isEqual: host]) return NO; if (otherURL->port != port) return NO; - if (![otherURL->user isEqual: user]) + if (otherURL->user != user && ![otherURL->user isEqual: user]) return NO; - if (![otherURL->password isEqual: password]) + if (otherURL->password != password && + ![otherURL->password isEqual: password]) return NO; if (![otherURL->path isEqual: path]) return NO; - if (![otherURL->parameters isEqual: parameters]) + if (otherURL->parameters != parameters && + ![otherURL->parameters isEqual: parameters]) return NO; - if (![otherURL->query isEqual: query]) + if (otherURL->query != query && + ![otherURL->query isEqual: query]) return NO; - if (![otherURL->fragment isEqual: fragment]) + if (otherURL->fragment != fragment && + ![otherURL->fragment isEqual: fragment]) return NO; return YES; } Index: tests/OFURLTests.m ================================================================== --- tests/OFURLTests.m +++ tests/OFURLTests.m @@ -73,11 +73,12 @@ TEST(@"-[fragment]", [[u1 fragment] isEqual: @"f"] && [u4 fragment] == nil) TEST(@"-[copy]", R(u4 = [[u1 copy] autorelease])) - TEST(@"-[isEqual:]", [u1 isEqual: u4] && ![u2 isEqual: u3]) + TEST(@"-[isEqual:]", [u1 isEqual: u4] && ![u2 isEqual: u3] && + [[OFURL URLWithString: @"http://bar/"] isEqual: u3]) TEST(@"-[hash:]", [u1 hash] == [u4 hash] && [u2 hash] != [u3 hash]) EXPECT_EXCEPTION(@"Detection of invalid format", OFInvalidFormatException, [OFURL URLWithString: @"http"])