diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/io/qurl.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index 00588da15f..f8a8bd18e3 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -817,8 +817,10 @@ inline void QUrlPrivate::appendPath(QString &appendTo, QUrl::FormattingOptions o thePath = path.left(slash+1); } // check if we need to remove trailing slashes - if ((options & QUrl::StripTrailingSlash) && !thePath.isEmpty() && thePath != QLatin1String("/") && thePath.endsWith(QLatin1Char('/'))) - thePath.chop(1); + if (options & QUrl::StripTrailingSlash) { + while (thePath.length() > 1 && thePath.endsWith(QLatin1Char('/'))) + thePath.chop(1); + } if (appendingTo != Path && !(options & QUrl::EncodeDelimiters)) { if (!qt_urlRecode(appendTo, thePath.constData(), thePath.constEnd(), options, decodedPathInUrlActions)) |