Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/desktop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHannah von Reth <hannah.vonreth@owncloud.com>2021-01-05 19:43:31 +0300
committerMatthieu Gallien (Rebase PR Action) <matthieu_gallien@yahoo.fr>2021-06-16 13:54:06 +0300
commitd014293f6d93a34ea021ce287030a1f575f403c3 (patch)
tree49c35744bf4b6c6b16c0e5c65754c0dadce70307 /src/common
parent9ea8dd95f837ad61e7bc9ca97bb42ed352a549d0 (diff)
Ensure pathtoUNC is called with an absolute path
Diffstat (limited to 'src/common')
-rw-r--r--src/common/filesystembase.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/common/filesystembase.cpp b/src/common/filesystembase.cpp
index 9c3c33f30..8bbca4922 100644
--- a/src/common/filesystembase.cpp
+++ b/src/common/filesystembase.cpp
@@ -18,6 +18,7 @@
#include "filesystembase.h"
#include "utility.h"
+#include "common/asserts.h"
#include <QDateTime>
#include <QDir>
@@ -509,6 +510,7 @@ bool FileSystem::isJunction(const QString &filename)
#ifdef Q_OS_WIN
QString FileSystem::pathtoUNC(const QString &_str)
{
+ ASSERT(QFileInfo(_str).isAbsolute());
if (_str.isEmpty()) {
return _str;
}
@@ -522,6 +524,7 @@ QString FileSystem::pathtoUNC(const QString &_str)
// prepend \\?\ and to support long names
if (str.at(0) == sep) {
+ // should not happen as we require the path to be absolute
return QStringLiteral(R"(\\?)") + str;
}
return QStringLiteral(R"(\\?\)") + str;