From: Kevin McCarthy Date: Wed, 28 Sep 2016 01:15:25 +0000 (-0700) Subject: RFC2047-decode mailto header values. (closes #3879) X-Git-Tag: neomutt-20161002~1^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8fbd61a8de32de265d3dcb1468159065dfaaf0e2;p=neomutt RFC2047-decode mailto header values. (closes #3879) RFC 6068 specifies that the header values (with the exception of body) may contain RFC 2047-encoded values. --- diff --git a/url.c b/url.c index d11b8d73a..5bbe9c4cd 100644 --- a/url.c +++ b/url.c @@ -29,6 +29,7 @@ #include "url.h" #include "mime.h" +#include "rfc2047.h" #include @@ -309,12 +310,17 @@ int url_parse_mailto (ENVELOPE *e, char **body, const char *src) else { char *scratch; + char *decoded_value; size_t taglen = mutt_strlen (tag); - safe_asprintf (&scratch, "%s: %s", tag, value); + decoded_value = safe_strdup (value); + rfc2047_decode (&decoded_value); + + safe_asprintf (&scratch, "%s: %s", tag, decoded_value); scratch[taglen] = 0; /* overwrite the colon as mutt_parse_rfc822_line expects */ value = skip_email_wsp(&scratch[taglen + 1]); mutt_parse_rfc822_line (e, NULL, scratch, value, 1, 0, 0, &last); + FREE (&decoded_value); FREE (&scratch); } }