changeset: 6802:55819a7e6169
user:      Kevin McCarthy <[email protected]>
date:      Tue Sep 27 18:15:25 2016 -0700
link:      http://dev.mutt.org/hg/mutt/rev/55819a7e6169

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.

diffs (30 lines):

diff -r efb8c7808715 -r 55819a7e6169 url.c
--- a/url.c     Sun Sep 25 13:26:58 2016 -0700
+++ b/url.c     Tue Sep 27 18:15:25 2016 -0700
@@ -29,6 +29,7 @@
 #include "url.h"
 
 #include "mime.h"
+#include "rfc2047.h"
 
 #include <ctype.h>
 
@@ -304,12 +305,17 @@
       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);
       }
     }

Reply via email to