mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-27 08:47:22 +03:00
Ensure pathtoUNC is called with an absolute path
This commit is contained in:
parent
9ea8dd95f8
commit
d014293f6d
1 changed files with 3 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue