diff options
Diffstat (limited to 'src/corelib/io/qurl.cpp')
-rw-r--r-- | src/corelib/io/qurl.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index 07024d3ba8..68523cd3d4 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -2382,7 +2382,11 @@ bool QUrl::operator ==(const QUrl &url) const return url.d->isEmpty(); if (!url.d) return d->isEmpty(); - return d->sectionIsPresent == url.d->sectionIsPresent && + + // Compare which sections are present, but ignore Host + // which is set by parsing but not by construction, when empty. + const int mask = QUrlPrivate::FullUrl & ~QUrlPrivate::Host; + return (d->sectionIsPresent & mask) == (url.d->sectionIsPresent & mask) && d->scheme == url.d->scheme && d->userName == url.d->userName && d->password == url.d->password && |