diff options
author | Thomas Roessler <roessler@does-not-exist.org> | 1999-11-10 21:35:33 +0000 |
---|---|---|
committer | Thomas Roessler <roessler@does-not-exist.org> | 1999-11-10 21:35:33 +0000 |
commit | c2a6707d1d426e0ae0d2665c52787bbde67efc47 (patch) | |
tree | bfd1c4d1668e48c09b80c901bde59f063989b627 /rfc2231.c | |
parent | 62399c99417fc22fe10cf2f88e862b00d31cdc7a (diff) |
Ignore empty MIME parameters.
Diffstat (limited to 'rfc2231.c')
-rw-r--r-- | rfc2231.c | 25 |
1 files changed, 24 insertions, 1 deletions
@@ -56,6 +56,25 @@ static void rfc2231_free_parameter (struct rfc2231_parameter **); static void rfc2231_join_continuations (PARAMETER **, struct rfc2231_parameter *); static void rfc2231_list_insert (struct rfc2231_parameter **, struct rfc2231_parameter *); +static void purge_empty_parameters (PARAMETER **headp) +{ + PARAMETER *p, *q, **last; + + for (last = headp, p = *headp; p; p = q) + { + q = p->next; + if (!p->attribute || !p->value) + { + *last = q; + p->next = NULL; + mutt_free_parameter (&p); + } + else + last = &p->next; + } +} + + void rfc2231_decode_parameters (PARAMETER **headp) { PARAMETER *head = NULL; @@ -70,8 +89,10 @@ void rfc2231_decode_parameters (PARAMETER **headp) int encoded; int index; - + if (!headp) return; + + purge_empty_parameters (headp); for (last = &head, p = *headp; p; p = q) { @@ -134,6 +155,8 @@ void rfc2231_decode_parameters (PARAMETER **headp) rfc2231_join_continuations (last, conthead); *headp = head; + + purge_empty_parameters (headp); } static struct rfc2231_parameter *rfc2231_new_parameter (void) |