- while (state == BODY) {
- state = m_getfld(state, name, tmpbuf, SBUFSIZ,
- inb);
+ blankline = 0;
+ while ((state = m_getfld2(state, &f, inb)) == BODY2) {
+ /*
+ ** recognize From lines without blank lines
+ ** before them as well.
+ */
+ if (strncmp("From ", f.value, 5)==0) {
+ state = FILEEOF2;
+ goto finished;
+ }
+ /*
+ ** delay the printing of blank lines
+ ** because if it's the end of the message,
+ ** then we must omit the blank line,
+ ** as it is not part of the message but
+ ** part of the mbox format
+ */
+ if (blankline) {
+ /* print the delayed blank line */
+ FPUTS("\n");
+ blankline = 0;
+ }
+ if (strcmp(f.value, "\n")==0) {
+ blankline = 1;
+ continue;
+ }