summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Faure <faure+bluesystems@kde.org>2013-07-08 14:20:03 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-07-20 21:04:29 +0200
commitd5d07f26f683e4737b0ecc7da4a8cfce493aec2d (patch)
tree029a35964719cefb8daf490a62b0f0da3ef4fe56 /src
parent0f062f42b9817205aab657dcfaeaa8c3ed302889 (diff)
QUrl: let StripTrailingSlash remove multiple trailing slashes
Change-Id: Ic4c8f70bb729630d9110ed6766dd9e40f9ab4d80 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/io/qurl.cpp6
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))