aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2017-08-05 17:46:25 +0200
committerLeah Neukirchen <leah@vuxu.org>2017-08-05 17:46:25 +0200
commit05e4d5b5fa66e4fbf4ffd7f5a950ff00312b5d42 (patch)
treebad7c6dda3a31955d1eb3d16905887a6a8ae179b
parent3b51c5938a82f831c5f734630fdebb165f747ced (diff)
downloadmblaze-05e4d5b5fa66e4fbf4ffd7f5a950ff00312b5d42.tar.gz
mshow: fallback to text/plain when no content-type exists
-rw-r--r--mshow.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/mshow.c b/mshow.c
index 8d4ae24..dc890fa 100644
--- 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);