aboutsummaryrefslogtreecommitdiffstats
path: root/src/client
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2023-01-22 13:26:35 +0000
committerVsevolod Stakhov <vsevolod@rspamd.com>2023-01-22 13:26:35 +0000
commit5aaa3869e1637921dfd1196faad2b128dec97caf (patch)
tree8c537faee0bdcfcd7ee43ca44fe18925c1c093b8 /src/client
parentbe93d9a1a230103bfa3ef186bfb27987acd2b209 (diff)
downloadrspamd-5aaa3869e1637921dfd1196faad2b128dec97caf.tar.gz
rspamd-5aaa3869e1637921dfd1196faad2b128dec97caf.zip
[Minor] Further adjustments to the word wrapping
Diffstat (limited to 'src/client')
-rw-r--r--src/client/rspamc.cxx9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/client/rspamc.cxx b/src/client/rspamc.cxx
index 5a8cb0d40..9fa56decd 100644
--- a/src/client/rspamc.cxx
+++ b/src/client/rspamc.cxx
@@ -834,15 +834,15 @@ rspamc_print_indented_line(FILE *out, std::string_view line) -> void
using namespace std::literals;
constexpr const auto whitespace = " \f\n\r\t\v"sv;
- constexpr const auto break_begin = " \f\n\r\t\v?,;\"'<({[~!@#$%^&*+:-=/\\|"sv;
- constexpr const auto break_end = " \f\n\r\t\v?.,;\"']})>~!@#$%^&*+:-_=/\\|"sv;
+ constexpr const auto break_begin = " \f\n\r\t\v?,;<({[~!#$%^&*+:=/\\|"sv;
+ constexpr const auto break_end = " \f\n\r\t\v?,;]})>~!#$%^&*+:_=/\\|"sv;
for (size_t pos = 0; pos < line.size(); ) {
auto len = pos ? (maxlen-indent) : maxlen;
auto s = line.substr(pos, len);
if (s.size() == len && // is string long enough?
(pos + s.size()) < line.size() && // reached EOL?
- line.find_first_of(break_begin, pos + s.size()) != 0 // new word next?
+ break_begin.find_first_of( line.at(pos + s.size())) == std::string_view::npos // new word next?
) {
auto wrap_at = s.find_last_of(break_end);
if (wrap_at != std::string_view::npos) {
@@ -898,9 +898,6 @@ rspamc_symbol_human_output(FILE *out, const ucl_object_t *obj)
}
line += ']';
}
- else if (desc == nullptr) {
- line += '\n';
- }
rspamc_print_indented_line<78, 28>(out, line);
}