From 210fd80167f9ff5d86006538fe36ca4ddfc5f6e0 Mon Sep 17 00:00:00 2001 From: Vladimir Golovnev Date: Fri, 14 Jan 2022 15:17:17 +0300 Subject: [PATCH] Correctly concatenate paths PR #16086. --- src/base/bittorrent/torrentimpl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/base/bittorrent/torrentimpl.cpp b/src/base/bittorrent/torrentimpl.cpp index 7f67e2af3..74ffbc4ae 100644 --- a/src/base/bittorrent/torrentimpl.cpp +++ b/src/base/bittorrent/torrentimpl.cpp @@ -1892,9 +1892,10 @@ void TorrentImpl::handleFileRenamedAlert(const lt::file_renamed_alert *p) ++pathIdx; } + QDir storageDir {actualStorageLocation()}; for (int i = (oldPathParts.size() - 1); i >= pathIdx; --i) { - QDir().rmdir(savePath() + Utils::String::join(oldPathParts, QString::fromLatin1("/"))); + storageDir.rmdir(Utils::String::join(oldPathParts, QString::fromLatin1("/"))); oldPathParts.removeLast(); }