From 0f56cd4b6a99ef11749425c9b15a3661a6f9a2cb Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 9 May 2018 13:12:44 +0200 Subject: Fix content cache partial download file --- src/Cache.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Cache.cpp b/src/Cache.cpp index 0b4bfbf..16cd4d0 100644 --- a/src/Cache.cpp +++ b/src/Cache.cpp @@ -217,7 +217,8 @@ namespace dchat imageDownloadMutex.lock(); contentUrlCache[it->url] = contentByUrlResult; - boost::filesystem::path downloadingFilepath = filepath / ".downloading"; + boost::filesystem::path downloadingFilepath = filepath; + downloadingFilepath += ".downloading"; // Intentionally ignore failure, program should not crash if we fail to remove these files... boost::system::error_code err; boost::filesystem::remove(downloadingFilepath, err); @@ -277,7 +278,8 @@ namespace dchat odhtdb::Hash urlHash(url.data(), url.size()); filepath /= urlHash.toString(); - boost::filesystem::path downloadingFilepath = filepath / ".downloading"; + boost::filesystem::path downloadingFilepath = filepath; + downloadingFilepath += ".downloading"; if(boost::filesystem::exists(downloadingFilepath)) { // Intentionally ignore failure, program should not crash if we fail to remove these files... -- cgit v1.2.3