From e2281bb4b857be90c2a7cc1520e526d565df1007 Mon Sep 17 00:00:00 2001 From: Joey Schulze Date: Fri, 25 Apr 2008 10:20:48 +0000 Subject: [PATCH] Only ignore linear-white-space between two encoded-words, lax interpretation of RFC 2047 5(1), similar to how Mutt works. --- rfc2047.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/rfc2047.c b/rfc2047.c index 4afd04a..cd6cc4b 100644 --- a/rfc2047.c +++ b/rfc2047.c @@ -137,8 +137,9 @@ char *convert_header(char *buf) while ((encstart = strstr (inp, "=?"))) { if (encstart != inp) { - memcpy (outp, inp, encstart-inp-1); - outp += encstart-inp-1; + // -1 nur falls vorher kein encoded-word + memcpy (outp, inp, encstart-inp); + outp += encstart-inp; } charset = encstart+2; @@ -171,6 +172,10 @@ char *convert_header(char *buf) *wordp = '\0'; wordp += 2; + /* Look for next =?, spaces will be eaten between two encoded-words */ + if (*wordp && *wordp == ' ' && *(wordp+1) && *(wordp+1) == '=' && *(wordp+2) && *(wordp+2) == '?') + wordp++; + switch (encoding) { case 'B': decode = decode_base64 (inp); -- 2.20.1