mblaze

Unix utilities to deal with Maildir - my mirror
git clone https://pi.duncano.de/git/mblaze.git
Log | Files | Refs | README | COPYING

commit 05e4d5b5fa66e4fbf4ffd7f5a950ff00312b5d42
parent 3b51c5938a82f831c5f734630fdebb165f747ced
Author: Leah Neukirchen <leah@vuxu.org>
Date:   Sat,  5 Aug 2017 17:46:25 +0200

mshow: fallback to text/plain when no content-type exists

Diffstat:
mshow.c | 8+++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/mshow.c b/mshow.c @@ -28,6 +28,8 @@ static char *hflag = defaulthflags; static char *xflag; static char *Oflag; +static char fallback_ct[] = "text/plain"; + struct message *filters; static int mimecount; @@ -181,7 +183,7 @@ render_mime(int depth, struct message *msg, char *body, size_t bodylen) { char *ct = blaze822_hdr(msg, "content-type"); if (!ct) - ct = "text/x-unknown"; + ct = fallback_ct; char *mt = mimetype(ct); char *tlmt = tlmimetype(ct); char *filename = mime_filename(msg); @@ -309,7 +311,7 @@ choose_alternative(struct message *msg, int depth) m++; char *ict = blaze822_hdr(imsg, "content-type"); if (!ict) - ict = "text/x-unknown"; + ict = fallback_ct; char *imt = mimetype(ict); char *s = strstr(Aflag, imt); @@ -366,7 +368,7 @@ list_mime(int depth, struct message *msg, char *body, size_t bodylen) char *ct = blaze822_hdr(msg, "content-type"); if (!ct) - ct = "text/x-unknown"; + ct = fallback_ct; char *mt = mimetype(ct); char *filename = mime_filename(msg);