Commit 45ec96c8 45ec96c88fa37178cb1485930bd10524733c24ad by Sergey Poznyakoff

Bugfix: display messages without Subject: or From: headers.

1 parent 467bb959
...@@ -32,7 +32,7 @@ mail_from (int argc, char **argv) ...@@ -32,7 +32,7 @@ mail_from (int argc, char **argv)
32 header_t hdr = NULL; 32 header_t hdr = NULL;
33 envelope_t env; 33 envelope_t env;
34 attribute_t attr; 34 attribute_t attr;
35 char *from = NULL, *subj = NULL; 35 char *from = NULL, *subj = NULL, *fromp, *subjp;
36 int froml, subjl; 36 int froml, subjl;
37 char date[80], st[10]; 37 char date[80], st[10];
38 int cols = util_getcols () - 6; 38 int cols = util_getcols () - 6;
...@@ -70,13 +70,6 @@ mail_from (int argc, char **argv) ...@@ -70,13 +70,6 @@ mail_from (int argc, char **argv)
70 } 70 }
71 header_aget_value (hdr, MU_HEADER_SUBJECT, &subj); 71 header_aget_value (hdr, MU_HEADER_SUBJECT, &subj);
72 72
73 if (from == NULL || subj == NULL)
74 {
75 free (from);
76 free (subj);
77 return 1;
78 }
79
80 message_get_attribute (msg, &attr); 73 message_get_attribute (msg, &attr);
81 74
82 if (attribute_is_userflag(attr, MAIL_ATTRIBUTE_MBOXED)) 75 if (attribute_is_userflag(attr, MAIL_ATTRIBUTE_MBOXED))
...@@ -113,9 +106,11 @@ mail_from (int argc, char **argv) ...@@ -113,9 +106,11 @@ mail_from (int argc, char **argv)
113 froml = cols / 3; 106 froml = cols / 3;
114 subjl = cols - froml - strlen (st) - strlen (date); 107 subjl = cols - froml - strlen (st) - strlen (date);
115 108
109 fromp = from ? from : "";
110 subjp = subj ? subj : fromp;
116 fprintf (ofile, "%c%c%4d %-18.18s %-16.16s %s %.*s\n", 111 fprintf (ofile, "%c%c%4d %-18.18s %-16.16s %s %.*s\n",
117 cursor == realcursor ? '>' : ' ', cflag, cursor, 112 cursor == realcursor ? '>' : ' ', cflag, cursor,
118 from, date, st, (subjl < 0) ? 0 : subjl, subj); 113 fromp, date, st, (subjl < 0) ? 0 : subjl, subjp);
119 114
120 free (from); 115 free (from);
121 free (subj); 116 free (subj);
......