Tue, 18 Feb 2025 18:30:47 +0100
fix crash when author map contains blank lines - fixes #598
src/settings.cpp | file | annotate | diff | comparison | revisions |
--- a/src/settings.cpp Wed Feb 05 23:51:33 2025 +0100 +++ b/src/settings.cpp Tue Feb 18 18:30:47 2025 +0100 @@ -54,8 +54,9 @@ } std::string_view trim(const std::string& str) { - size_t s = str.find_first_not_of(" \t"); - size_t l = str.find_last_not_of(" \t") + 1 - s; + size_t s = str.find_first_not_of(" \t\r"); + if (s == std::string::npos) return ""; + size_t l = str.find_last_not_of(" \t\r") + 1 - s; return std::string_view{str}.substr(s, l); }