summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qurl.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2016-07-08 15:30:45 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2016-12-12 07:25:22 +0000
commit101449a4cfa9c0d216332c6dc8ba826e8109e09d (patch)
tree9a5494bdc1c1819d837a97e74fc220f85e4e8310 /src/corelib/io/qurl.cpp
parentf7b44f879cdded7b2c6b604df873f7194e56a63a (diff)
QDir::cd(): Handle UNC server paths correctly
Add a bool *ok out parameter to qt_normalizePathSegments() and return false when ".." are left over for an absolute path, indicating an attempt to change above root. Factor out static helper qt_cleanPath() to be able to pass the return value to QDir::cd() and return on failure from there. Amends change 63f634322b2c0f795bd424be9e51953a10c701de, which did not handle UNC paths. Task-number: QTBUG-53712 Change-Id: I3e63a5dd0259306a0b99145348d815899582f78e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io/qurl.cpp')
-rw-r--r--src/corelib/io/qurl.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp
index 60ce752eb6..066052ade9 100644
--- a/src/corelib/io/qurl.cpp
+++ b/src/corelib/io/qurl.cpp
@@ -417,7 +417,8 @@
#include "qurlquery.h"
QT_BEGIN_NAMESPACE
-extern QString qt_normalizePathSegments(const QString &name, bool allowUncPaths); // qdir.cpp
+extern QString qt_normalizePathSegments(const QString &name, bool allowUncPaths,
+ bool *ok = nullptr); // qdir.cpp
inline static bool isHex(char c)
{