]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-mail: message-snippet - Count '>' in quoted snippet towards max_snippet_chars
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 25 Feb 2020 12:33:31 +0000 (14:33 +0200)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 26 Feb 2020 08:14:23 +0000 (10:14 +0200)
src/lib-mail/message-snippet.c
src/lib-mail/test-message-snippet.c

index e108b5821b331ad8543c81f9327e0a410b020edf..441d03d308f7b8a56bfd4e619cd7611b7bbf4a7d 100644 (file)
@@ -143,7 +143,7 @@ int message_snippet_generate(struct istream *input,
        ctx.snippet.snippet = str_new(pool, max_snippet_chars);
        ctx.snippet.chars_left = max_snippet_chars;
        ctx.quoted_snippet.snippet = str_new(pool, max_snippet_chars);
-       ctx.quoted_snippet.chars_left = max_snippet_chars;
+       ctx.quoted_snippet.chars_left = max_snippet_chars - 1; /* -1 for '>' */
        parser = message_parser_init(pool_datastack_create(), input, 0, 0);
        decoder = message_decoder_init(NULL, 0);
        while ((ret = message_parser_parse_next_block(parser, &raw_block)) > 0) {
index 387a10734111c4ea112f39ef0a12215c16387c41..35289367dee87764bb54c465d3586e1b6f353977 100644 (file)
@@ -84,7 +84,7 @@ static const struct {
        { "Content-Type: text/plain\n"
          "\n"
          ">quoted long text",
-         6,
+         7,
          ">quoted" },
        { "Content-Type: text/plain; charset=utf-8\n"
          "\n"