diff options
author | David Faure <david.faure@kdab.com> | 2015-12-06 14:37:58 +0100 |
---|---|---|
committer | David Faure <david.faure@kdab.com> | 2015-12-22 09:56:27 +0000 |
commit | 2e1de7f3c4cab55ce6b65f945cf0f444e6bee53a (patch) | |
tree | 7d2b7edc2542f99e77405d13a8136de8719283e9 /src | |
parent | 5f03b48cb38936e2e86143bec71d030876b84c8b (diff) |
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 <thiago.macieira@intel.com>
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 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()) |