From 9ea776b2a10e7eec1933f79caf73220b691262b2 Mon Sep 17 00:00:00 2001 From: markus schnalke Date: Thu, 22 Mar 2012 21:40:36 +0100 Subject: [PATCH] scansbr: Minor refactoring. --- uip/scansbr.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/uip/scansbr.c b/uip/scansbr.c index 7dedf70..4b2add5 100644 --- a/uip/scansbr.c +++ b/uip/scansbr.c @@ -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; -- 1.7.10.4