}
for (i = 1; i <= nmsgs; i++) {
+ charstring_t scanl = NULL;
+
msgnum++;
if (packfile) {
fseek (pf, 0L, SEEK_CUR);
}
switch (incerr = scan (pf, msgnum, 0, nfs, width,
packfile ? 0 : msgnum == mp->hghmsg + 1 && chgflag,
- 1, NULL, stop - start, noisy)) {
+ 1, NULL, stop - start, noisy, &scanl)) {
case SCNEOF:
printf ("%*d empty\n", DMAXFOLDER, msgnum);
break;
case SCNENC:
default:
if (aud)
- fputs (scanl, aud);
+ fputs (charstring_buffer (scanl), aud);
if (noisy)
fflush (stdout);
break;
}
+ charstring_free (scanl);
+
if (packfile) {
fseek (pf, stop, SEEK_SET);
fwrite (mmdlm2, 1, strlen (mmdlm2), pf);
scan_detect_mbox_style (in); /* the MAGIC invocation... */
hghnum = msgnum = mp->hghmsg;
for (;;) {
+ charstring_t scanl = NULL;
+
/* create scanline for new message */
switch (incerr = scan (in, msgnum + 1, msgnum + 1, nfs, width,
- msgnum == hghnum && chgflag, 1, NULL, 0L, noisy)) {
+ msgnum == hghnum && chgflag, 1, NULL, 0L, noisy,
+ &scanl)) {
case SCNFAT:
case SCNEOF:
break;
(void)ext_hook("add-hook", b, (char *)0);
if (aud)
- fputs (scanl, aud);
+ fputs (charstring_buffer (scanl), aud);
if (noisy)
fflush (stdout);
msgnum++;
continue;
}
+ charstring_free (scanl);
+
/* If we get here there was some sort of error from scan(),
* so stop processing anything more from the spool.
*/
hghnum = msgnum = mp->hghmsg;
for (i = 0; i < num_maildir_entries; i++) {
+ charstring_t scanl = NULL;
+
msgnum++;
sp = Maildir[i].filename;
fseek (pf, 0L, SEEK_SET);
switch (incerr = scan (pf, msgnum, 0, nfs, width,
msgnum == mp->hghmsg + 1 && chgflag,
- 1, NULL, stop - start, noisy)) {
+ 1, NULL, stop - start, noisy, &scanl)) {
case SCNEOF:
printf ("%*d empty\n", DMAXFOLDER, msgnum);
break;
(void)ext_hook("add-hook", b, (char *)0);
if (aud)
- fputs (scanl, aud);
+ fputs (charstring_buffer (scanl), aud);
if (noisy)
fflush (stdout);
break;
}
+ charstring_free (scanl);
+
if (ferror(pf) || fclose (pf)) {
int e = errno;
(void) m_unlink (cp);