about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--mpick.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/mpick.c b/mpick.c
index b0e15cd..b44d221 100644
--- a/mpick.c
+++ b/mpick.c
@@ -761,6 +761,9 @@ msg_date(struct mailinfo *m)
 	if (m->date)
 		return m->date;
 
+	if (!m->msg)
+		m->msg = blaze822(m->fpath);
+
 	char *b;
 	if (m->msg && (b = blaze822_hdr(m->msg, "date")))
 		return (m->date = blaze822_date(b));
@@ -774,6 +777,9 @@ msg_subject(struct mailinfo *m)
 	if (!m->subject)
 		return m->subject;
 
+	if (!m->msg)
+		m->msg = blaze822(m->fpath);
+
 	char *b;
 	if (!m->msg || !(b = blaze822_hdr(m->msg, "subject")))
 		return "";
@@ -785,6 +791,9 @@ msg_subject(struct mailinfo *m)
 char *
 msg_addr(struct mailinfo *m, char *h, int t)
 {
+	if (!m->msg)
+		m->msg = blaze822(m->fpath);
+
 	char *b;
 	if (m->msg == 0 || (b = blaze822_chdr(m->msg, h)) == 0)
 		return "";
@@ -949,10 +958,6 @@ mailfile(char *file)
 		return m;
 	}
 
-	m->msg = blaze822(m->fpath);
-	if (!m->msg)
-		return m;
-
 	if ((e = strrchr(m->fpath, '/') - 1) && (e - m->fpath) >= 2 &&
 	    *e-- == 'w' && *e-- == 'e' && *e-- == 'n')
 		m->flags |= FLAG_NEW;