X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=uip%2Fscansbr.c;h=eba09f04ffbecbca27c94a0a0afab46cc37e14db;hb=f8960957ae53f962fe12e5a5eb4c01eb54cb4228;hp=7dedf70574f5027a2fa1722107842bf91e63fb50;hpb=d7b4f0034bc4f5b5c2f990d0984858e9b6f4131a;p=mmh diff --git a/uip/scansbr.c b/uip/scansbr.c index 7dedf70..eba09f0 100644 --- a/uip/scansbr.c +++ b/uip/scansbr.c @@ -76,8 +76,8 @@ scan(FILE *inb, int innum, int outnum, char *fmtstr, int width, int curflg, char name[NAMESZ]; char returnpath[BUFSIZ]; char deliverydate[BUFSIZ]; - int incing = (outnum > 0); - int scanfolder = (outnum == 0); + int incing = (outnum != SCN_MBOX && outnum != SCN_FOLD); + int scanfolder = (outnum == SCN_FOLD); long fpos; /* first-time only initialization */ @@ -204,26 +204,23 @@ scan(FILE *inb, int innum, int outnum, char *fmtstr, int width, int curflg, case BODY: compnum = -1; - if (!incing) { - /* 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); - } + if (scanfolder) { + /* stop here if we scan a msg in a folder */ + state = FILEEOF; goto finished; } - FPUTS("\n"); - FPUTS(tmpbuf); + /* otherwise (mbox): snarf the body */ + if (incing) { + FPUTS("\n"); + FPUTS(tmpbuf); + } body:; while (state == BODY) { state = m_getfld(state, name, tmpbuf, SBUFSIZ, inb); - FPUTS(tmpbuf); + if (incing) { + FPUTS(tmpbuf); + } } goto finished;