From 19815109c39cd0194b83119bda849d49c0fe9d46 Mon Sep 17 00:00:00 2001 From: Sude Date: Sun, 16 Apr 2023 02:39:56 +0300 Subject: [PATCH] Don't print file size or hash for missing files in --status output --- src/downloader.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/downloader.cpp b/src/downloader.cpp index 168ca8b..92a1f82 100644 --- a/src/downloader.cpp +++ b/src/downloader.cpp @@ -1902,7 +1902,15 @@ void Downloader::checkStatus() void Downloader::addStatusLine(const std::string& statusCode, const std::string& gamename, const std::string& filepath, const uintmax_t& filesize, const std::string& localHash) { - std::cout << statusCode << " " << gamename << " " << filepath << " " << filesize << " " << localHash << std::endl; + std::cout << statusCode << " " << gamename << " " << filepath; + + if (filesize > 0) + std::cout << " " << filesize; + + if (!localHash.empty()) + std::cout << " " << localHash; + + std::cout << std::endl; return; }