diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-04-03 17:49:52 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-04-03 17:57:59 +0100 |
commit | f398b79492ca89ae5293e7c8ede235f22344ed1b (patch) | |
tree | 9c2d4390665b9398e236d29f0eb1879e14aef4c7 /src/libutil/str_util.c | |
parent | 141ece7c00744f0e6ce53757fd9b99cf9548a619 (diff) | |
download | rspamd-f398b79492ca89ae5293e7c8ede235f22344ed1b.tar.gz rspamd-f398b79492ca89ae5293e7c8ede235f22344ed1b.zip |
[Minor] When fold on chars skip other folding logic
Issue: #2111
Diffstat (limited to 'src/libutil/str_util.c')
-rw-r--r-- | src/libutil/str_util.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/libutil/str_util.c b/src/libutil/str_util.c index d571efabb..3b1f3c1e3 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 ++; } |