From: Vsevolod Stakhov Date: Tue, 3 Apr 2018 16:49:52 +0000 (+0100) Subject: [Minor] When fold on chars skip other folding logic X-Git-Tag: 1.7.3~41 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f398b79492ca89ae5293e7c8ede235f22344ed1b;p=thirdparty%2Frspamd.git [Minor] When fold on chars skip other folding logic Issue: #2111 --- diff --git a/src/libutil/str_util.c b/src/libutil/str_util.c index d571efabb0..3b1f3c1e30 100644 --- a/src/libutil/str_util.c +++ b/src/libutil/str_util.c @@ -958,10 +958,12 @@ rspamd_header_value_fold (const gchar *name, switch (state) { case read_token: - if (fold_on_chars && strchr (fold_on_chars, *p) != NULL) { - fold_type = fold_after; - state = fold_token; - next_state = read_token; + if (fold_on_chars) { + if (strchr (fold_on_chars, *p) != NULL) { + fold_type = fold_after; + state = fold_token; + next_state = read_token; + } p ++; } @@ -1153,7 +1155,7 @@ rspamd_header_value_fold (const gchar *name, /* Last token */ switch (state) { case read_token: - if (cur_len > fold_max && !first_token) { + if (!fold_on_chars && cur_len > fold_max && !first_token) { if (g_ascii_isspace (*c)) { c ++; }