summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/OFURL.m6
-rw-r--r--tests/OFURLTests.m2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/OFURL.m b/src/OFURL.m
index 2069d0cb..96f4b5bf 100644
--- a/src/OFURL.m
+++ b/src/OFURL.m
@@ -482,9 +482,9 @@
if (_host != nil)
[ret appendString: [_host stringByURLEncoding]];
- if (([_scheme isEqual: @"http"] && _port != 80) ||
- ([_scheme isEqual: @"https"] && _port != 443) ||
- ([_scheme isEqual: @"ftp"] && _port != 21))
+ if (!(([_scheme isEqual: @"http"] && _port == 80) ||
+ ([_scheme isEqual: @"https"] && _port == 443) ||
+ ([_scheme isEqual: @"ftp"] && _port == 21)))
[ret appendFormat: @":%u", _port];
if (_path != nil)
diff --git a/tests/OFURLTests.m b/tests/OFURLTests.m
index 2748afcc..3f0b223b 100644
--- a/tests/OFURLTests.m
+++ b/tests/OFURLTests.m
@@ -60,7 +60,7 @@ static OFString *url_str = @"ht%3Atp://us%3Aer:p%40w@ho%3Ast:1234/"
[[u4 string] isEqual: @"file:///etc/passwd"])
TEST(@"-[scheme]",
- [[u1 scheme] isEqual: @"ht%3Atp"] && [[u4 scheme] isEqual: @"file"])
+ [[u1 scheme] isEqual: @"ht:tp"] && [[u4 scheme] isEqual: @"file"])
TEST(@"-[user]", [[u1 user] isEqual: @"us:er"] && [u4 user] == nil)
TEST(@"-[password]",
[[u1 password] isEqual: @"p@w"] && [u4 password] == nil)