summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/KURL.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/platform/KURL.cpp')
-rw-r--r--WebCore/platform/KURL.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/WebCore/platform/KURL.cpp b/WebCore/platform/KURL.cpp
index 12ba4a2..9ed900f 100644
--- a/WebCore/platform/KURL.cpp
+++ b/WebCore/platform/KURL.cpp
@@ -1353,27 +1353,29 @@ bool protocolHostAndPortAreEqual(const KURL& a, const KURL& b)
{
if (a.m_schemeEnd != b.m_schemeEnd)
return false;
+
int hostStartA = a.hostStart();
+ int hostLengthA = a.hostEnd() - hostStartA;
int hostStartB = b.hostStart();
- if (a.m_hostEnd - hostStartA != b.m_hostEnd - hostStartB)
+ int hostLengthB = b.hostEnd() - b.hostStart();
+ if (hostLengthA != hostLengthB)
return false;
// Check the scheme
for (int i = 0; i < a.m_schemeEnd; ++i)
if (a.string()[i] != b.string()[i])
return false;
-
+
// And the host
- for (int i = hostStartA; i < a.m_hostEnd; ++i)
- if (a.string()[i] != b.string()[i])
+ for (int i = 0; i < hostLengthA; ++i)
+ if (a.string()[hostStartA + i] != b.string()[hostStartB + i])
return false;
-
+
if (a.port() != b.port())
return false;
return true;
}
-
String encodeWithURLEscapeSequences(const String& notEncodedString)
{