summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/corelib/io/qurl.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp
index aed1be2ffb..649b3a009c 100644
--- a/src/corelib/io/qurl.cpp
+++ b/src/corelib/io/qurl.cpp
@@ -2159,7 +2159,7 @@ QString QUrl::toString(FormattingOptions options) const
d->appendPath(url, options, QUrlPrivate::FullUrl);
// check if we need to remove trailing slashes
- while ((options & StripTrailingSlash) && url.endsWith(QLatin1Char('/')))
+ if ((options & StripTrailingSlash) && d->path != QLatin1String("/") && url.endsWith(QLatin1Char('/')))
url.chop(1);
}