commit 5fdbbae4a6d51860b0b4766769132c7f0f50461a Author: Anthony Ruhier Date: Thu Sep 17 12:38:29 2026 +0200 Fixes compatibility with GCC < 16 --- src/helpers/MiscFunctions.cpp | 11 ++++++++++- src/ipc/s1/S1.cpp | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/helpers/MiscFunctions.cpp b/src/helpers/MiscFunctions.cpp index 299d2199..a81e78f1 100644 --- a/src/helpers/MiscFunctions.cpp +++ b/src/helpers/MiscFunctions.cpp @@ -474,7 +474,16 @@ bool truthy(const std::string& str) { }); return [&](auto&&... prefixes) -> bool { - return (... || std::ranges::starts_with(str_view, prefixes)); + auto starts_with = [](auto&& range, std::string_view prefix) { + auto it = std::ranges::begin(range); + auto end = std::ranges::end(range); + for (char c : prefix) { + if (it == end || *it != c) return false; + ++it; + } + return true; + }; + return (... || starts_with(str_view, prefixes)); }("true"sv, "yes"sv, "on"sv); // clang-format on } diff --git a/src/ipc/s1/S1.cpp b/src/ipc/s1/S1.cpp index 76f2e9b5..6c0bed5d 100644 --- a/src/ipc/s1/S1.cpp +++ b/src/ipc/s1/S1.cpp @@ -145,7 +145,7 @@ SResponse CSocket1::dispatchBatch(std::string request, pid_t pid) { if (i < request.size() && (request[i + 1] == '\\' || request[i + 1] == ';')) ++i; else - LOG(Log::ERR, "Malformed socket1 request: invalid escape sequence {} at position {}, using it verbatim", request.subview(i, 2), i); + LOG(Log::ERR, "Malformed socket1 request: invalid escape sequence {} at position {}, using it verbatim", request.substr(i, 2), i); } parsedCommand << request[i]; }