From 0e358157f2e042bc191b9cdf852f5cf921c0a9e0 Mon Sep 17 00:00:00 2001 From: Green Sky Date: Mon, 10 Jun 2024 21:48:59 +0200 Subject: [PATCH] fix windows --- src/log_parse.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/log_parse.cpp b/src/log_parse.cpp index f4f8e3c..6b9691f 100644 --- a/src/log_parse.cpp +++ b/src/log_parse.cpp @@ -3,10 +3,14 @@ #include std::optional log_parse_line(std::string_view line) { + if (line.empty()) { + return std::nullopt; + } + static const std::regex mod_match{".*Factorio-Event-Logger+.*\\[([A-Z ]+)\\] (.+)$"}; std::cmatch matches; - if (!std::regex_match(line.cbegin(), line.cend(), matches, mod_match)) { + if (!std::regex_match(line.data(), line.data() + line.size(), matches, mod_match)) { return std::nullopt; }