mshow: show last part of multipart/mixed when none matched

This is in conformance with RFC 1341.
pull/201/head
Leah Neukirchen 3 years ago
parent 318ac214f1
commit e96f0707de

@ -56,7 +56,7 @@ in the order given,
when rendering
.Sq Li "multipart/alternative"
parts.
If no MIME type matches, the first MIME part will be rendered.
If no MIME type matches, the last MIME part will be rendered.
.Pp
When
.Ar mimetypes

@ -336,7 +336,7 @@ nofilter:
static void
choose_alternative(struct message *msg, int depth)
{
int n = 1;
int n = 0;
int m = 0;
char *p = Aflag + strlen(Aflag);
@ -363,6 +363,13 @@ choose_alternative(struct message *msg, int depth)
}
blaze822_free(imsg);
if (n == 0) {
// No part matched, use last part as per RFC1341 7.2.3
// "In general, choosing the best type means displaying
// only the LAST part that can be displayed."
n = m;
}
imsg = 0;
while (blaze822_multipart(msg, &imsg))
if (--n == 0)

Loading…
Cancel
Save