From 2e1de7f3c4cab55ce6b65f945cf0f444e6bee53a Mon Sep 17 00:00:00 2001 From: David Faure Date: Sun, 6 Dec 2015 14:37:58 +0100 Subject: QUrl: revert path-normalization in setPath(). Path normalization should happen only when NormalizePathSegments is set. Use a less intrusive fix for the setPath("//path") issue that commit aba336c2b4ad8 was about. This allows fromLocalFile("/tmp/.") to keep the "/." at the end, which is useful for appending to the path later on (e.g. to get "/tmp/.hidden") Change-Id: Ibc3d4d3276c1d3aaee1774e21e24d01af38fa880 Reviewed-by: Thiago Macieira --- src/corelib/io/qurl.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/corelib/io/qurl.cpp') diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index 9bf359222a..775a870a27 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -2470,8 +2470,10 @@ void QUrl::setPath(const QString &path, ParsingMode mode) mode = TolerantMode; } - data = qt_normalizePathSegments(data, false); - d->setPath(data, 0, data.length()); + int from = 0; + while (from < data.length() - 2 && data.midRef(from, 2) == QLatin1String("//")) + ++from; + d->setPath(data, from, data.length()); // optimized out, since there is no path delimiter // if (path.isNull()) -- cgit v1.2.3