Commit 5cfd852a authored by Harald Sitter's avatar Harald Sitter 🏳🌈
Browse files

sftp: fix free space query for urls with empty path

e.g. `sftp://localhost` has an empty path

fall back to assume it means '/'

Test Plan: free space correctly listed on sftp://localhost

Reviewers: ngraham, meven

Reviewed By: meven

Subscribers: kde-frameworks-devel, kfm-devel

Tags: #dolphin, #frameworks

Differential Revision:
parent 863d192b
......@@ -2601,7 +2601,7 @@ Result SFTPInternal::fileSystemFreeSpace(const QUrl& url)
return Result::fail(ERR_UNSUPPORTED_ACTION, QString());
const QByteArray path = url.path().toUtf8();
const QByteArray path = url.path().isEmpty() ? QByteArrayLiteral("/") : url.path().toUtf8();
sftp_statvfs_t statvfs = sftp_statvfs(mSftp, path.constData());
if (statvfs == nullptr) {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment