Writing to /dev/null had it's sense, as for scanning mboxes, the message size
had been determined this way and the file pointer had been pushed forward.
This is now done using the input file pointer instead of the output fp.
char deliverydate[BUFSIZ];
int incing = (outnum > 0);
int scanfolder = (outnum == 0);
char deliverydate[BUFSIZ];
int incing = (outnum > 0);
int scanfolder = (outnum == 0);
/* first-time only initialization */
if (!scanl) {
/* first-time only initialization */
if (!scanl) {
dat[0] = innum ? innum : outnum;
dat[1] = curflg;
dat[4] = unseen;
dat[0] = innum ? innum : outnum;
dat[1] = curflg;
dat[4] = unseen;
/*
** Get the first field. If the message is non-empty
/*
** Get the first field. If the message is non-empty
case BODY:
compnum = -1;
if (!incing) {
case BODY:
compnum = -1;
if (!incing) {
- state = FILEEOF; /* stop here if scan cmd */
+ /* stop here if scan cmd */
+ if (scanfolder) {
+ state = FILEEOF;
+ goto finished;
+ }
+ /* for mboxes: snarf the body */
+ while (state == BODY) {
+ state = m_getfld(state, name, tmpbuf,
+ SBUFSIZ, inb);
+ }
goto finished;
}
FPUTS("\n");
goto finished;
}
FPUTS("\n");
if (incing) {
if ((dat[2] = ftell(scnout)) == EOF)
adios(scnmsg, "write error on");
if (incing) {
if ((dat[2] = ftell(scnout)) == EOF)
adios(scnmsg, "write error on");
+ } else if (!scanfolder) {
+ if ((dat[2] = ftell(inb)) == EOF)
+ adios(scnmsg, "write error on");
+ dat[2] -= fpos;
}
if ((datecomp && !datecomp->c_text) || scanfolder) {
}
if ((datecomp && !datecomp->c_text) || scanfolder) {