From 64be289942b09943e8280f5ca468c8be4757f083 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Sat, 24 Feb 2024 14:54:53 +0000 Subject: [PATCH] Workaround: Replace use of std::filesystem in signature.cpp Creates DWARF generation problem with LTO and -g1 on MinGW --- src/signature.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/signature.cpp b/src/signature.cpp index 3577d4e039..c38c6d189c 100644 --- a/src/signature.cpp +++ b/src/signature.cpp @@ -20,8 +20,6 @@ #include "3rdparty/monocypher/monocypher-ed25519.h" #include "3rdparty/nlohmann/json.hpp" -#include - #include "safeguards.h" /** The public keys used for signature validation. */ @@ -247,7 +245,13 @@ static bool _ValidateSignatureFile(const std::string &filename) return false; } - std::string dirname = std::filesystem::path(filename).parent_path().string(); + std::string dirname; + auto pos = filename.rfind(PATHSEPCHAR); + if (pos == std::string::npos || pos == 0) { + dirname = filename; + } else { + dirname = filename.substr(0, pos); + } for (auto &signature : signatures["files"]) { const std::string sig_filename = dirname + PATHSEPCHAR + signature["filename"].get();