From 7c717e56f51e7e8b1ab756f4b2b9717dadb1d82c Mon Sep 17 00:00:00 2001 From: David Faure Date: Thu, 3 May 2012 18:49:46 +0200 Subject: Fix QUrl::toString(StripTrailingSlash) to not turn file:/// into file: It should only strip one slash (as the name indicates), and not if the path is just "/". Change-Id: I133a81977241de77a49d1d1559143d30e0bd52f8 Reviewed-by: Thiago Macieira --- src/corelib/io/qurl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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); } -- cgit v1.2.3