diff options
author | Hannah von Reth <hannah.vonreth@owncloud.com> | 2021-01-05 19:43:31 +0300 |
---|---|---|
committer | Hannah von Reth <vonreth@kde.org> | 2021-01-13 16:06:53 +0300 |
commit | 709b28e48e82eaec746abebd70c792fe350e561f (patch) | |
tree | ddb7bda9cd169698141a74934565fe25b023b7ea /src | |
parent | c1da0d3d409445aaa325e0078a6bc6fc9b01ecae (diff) |
Ensure pathtoUNC is called with an absolute path
Diffstat (limited to 'src')
-rw-r--r-- | src/common/filesystembase.cpp | 3 |
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; |