129 |
} |
} |
130 |
|
|
131 |
void |
void |
132 |
list_message (mh_format_t *format, mailbox_t mbox, size_t msgno, |
list_message (mh_format_t *format, mailbox_t mbox, size_t msgno, size_t width) |
|
char *buffer, size_t width) |
|
133 |
{ |
{ |
134 |
message_t msg; |
message_t msg; |
135 |
|
char *buf = NULL; |
136 |
|
|
|
buffer[0] = 0; |
|
137 |
mailbox_get_message (mbox, msgno, &msg); |
mailbox_get_message (mbox, msgno, &msg); |
138 |
mh_format (format, msg, msgno, buffer, width); |
mh_format (format, msg, msgno, width, &buf); |
139 |
printf ("%s\n", buffer); |
printf ("%s\n", buf); |
140 |
if (audit_fp) |
if (audit_fp) |
141 |
fprintf (audit_fp, "%s\n", buffer); |
fprintf (audit_fp, "%s\n", buf); |
142 |
|
free (buf); |
143 |
} |
} |
144 |
|
|
145 |
int |
int |
151 |
size_t lastmsg; |
size_t lastmsg; |
152 |
int f_truncate = 0; |
int f_truncate = 0; |
153 |
int f_changecur = 0; |
int f_changecur = 0; |
|
char *buffer; |
|
154 |
mh_format_t format; |
mh_format_t format; |
155 |
int rc; |
int rc; |
156 |
|
|
209 |
exit (1); |
exit (1); |
210 |
} |
} |
211 |
|
|
|
buffer = xmalloc (width); |
|
|
|
|
212 |
/* Fixup options */ |
/* Fixup options */ |
213 |
if (truncate_source == -1) |
if (truncate_source == -1) |
214 |
truncate_source = f_truncate; |
truncate_source = f_truncate; |
246 |
} |
} |
247 |
|
|
248 |
if (!quiet) |
if (!quiet) |
249 |
list_message (&format, output, lastmsg + n, buffer, width); |
list_message (&format, output, lastmsg + n, width); |
250 |
|
|
251 |
if (truncate_source) |
if (truncate_source) |
252 |
{ |
{ |