diff --git a/plugins/sftp/sftpplugin-win.cpp b/plugins/sftp/sftpplugin-win.cpp index 5450e5e3f..2f0d8ebef 100644 --- a/plugins/sftp/sftpplugin-win.cpp +++ b/plugins/sftp/sftpplugin-win.cpp @@ -50,10 +50,18 @@ void SftpPlugin::receivePacket(const NetworkPacket &np) QString path; if (np.has(QStringLiteral("multiPaths"))) { - path = QStringLiteral("/"); + QStringList paths = np.get(QStringLiteral("multiPaths")); + if (paths.size() == 1) { + path = paths[0]; + } else { + path = QStringLiteral("/"); + } } else { path = np.get(QStringLiteral("path")); } + if (!path.endsWith(QChar::fromLatin1('/'))) { + path += QChar::fromLatin1('/'); + } QString url_string = QStringLiteral("sftp://%1:%2@%3:%4%5") .arg(np.get(QStringLiteral("user")),