mblaze

Unix utilities to deal with Maildir - my mirror
git clone https://pi.duncano.de/git/mblaze.git
Log | Files | Refs | README | COPYING

commit 0ce958a22c82d45b4b0ce77dbcac2fd6f6822965
parent 2aaa3cecd8a21c975c5bea886c678775627e90e7
Author: Christian Neukirchen <chneukirchen@gmail.com>
Date:   Mon,  1 Aug 2016 14:26:37 +0200

mmime: only qp after newline when actually needed

Diffstat:
mmime.c | 18++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/mmime.c b/mmime.c @@ -245,13 +245,19 @@ print_header(char *line) { } if (s < e) { if (linelen + (e-s)+13 > 78) { - printf("\n"); - linelen = 0; + printf("\n "); + linelen = 1; + } + if (highbit || s[0] == ' ') { + printf("=?UTF-8?Q?"); + linelen += 13; + linelen += gen_qp((uint8_t *)s, e-s, 999, 1); + printf("?="); + } else { + fwrite(s, 1, e-s, stdout); + linelen += e-s; + prevq = 0; } - printf(" =?UTF-8?Q?"); - linelen += 13; - linelen += gen_qp((uint8_t *)s, e-s, 999, 1); - printf("?="); } prevq = 1; } else {