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

github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHannah von Reth <hannah.vonreth@owncloud.com>2021-01-05 19:43:31 +0300
committerHannah von Reth <vonreth@kde.org>2021-01-13 16:06:53 +0300
commit709b28e48e82eaec746abebd70c792fe350e561f (patch)
treeddb7bda9cd169698141a74934565fe25b023b7ea /src
parentc1da0d3d409445aaa325e0078a6bc6fc9b01ecae (diff)
Ensure pathtoUNC is called with an absolute path
Diffstat (limited to 'src')
-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 ba8050ec1..733b75f76 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>
@@ -501,6 +502,7 @@ bool FileSystem::isJunction(const QString &filename)
#ifdef Q_OS_WIN
QString FileSystem::pathtoUNC(const QString &_str)
{
+ OC_ASSERT(QFileInfo(_str).isAbsolute());
if (_str.isEmpty()) {
return _str;
}
@@ -514,6 +516,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("\\\\?") + str;
}
return QStringLiteral("\\\\?\\") + str;