From aefb2153a88a11cce249f709e10a19ad8d8d39fd Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sun, 22 Jan 2023 12:48:37 +0000 Subject: [PATCH] [Minor] Check the last split when wrapping Reported by: @amishmm --- src/client/rspamc.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/client/rspamc.cxx b/src/client/rspamc.cxx index c757000dbc..a2bf4c783c 100644 --- a/src/client/rspamc.cxx +++ b/src/client/rspamc.cxx @@ -847,6 +847,10 @@ rspamc_print_indented_line(FILE *out, std::string_view line) -> void suffix = suffix.substr(delim_pos + 1); } else { + /* Check if we can include one last word */ + if (delim_pos == std::string_view::npos && word_len + suffix.size() < split_len) { + word_len += suffix.size(); + } break; } } -- 2.47.3