char deliverydate[BUFSIZ];
int incing = (outnum > 0);
int scanfolder = (outnum == 0);
+ long fpos;
/* first-time only initialization */
if (!scanl) {
dat[0] = innum ? innum : outnum;
dat[1] = curflg;
dat[4] = unseen;
+ fpos = ftell(inb);
/*
** Get the first field. If the message is non-empty
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");
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) {