From 6b80b3bb772e2cf9186cf964bf78109b677e1bef Mon Sep 17 00:00:00 2001 From: markus schnalke Date: Tue, 20 Mar 2012 18:02:32 +0100 Subject: [PATCH] scan(): Replaced explicit noisy parameter with implicit nfs check. nfs is the ``new format string'' if it is NULL, we don't (and actually can't) print a scan line. --- h/scansbr.h | 2 +- uip/inc.c | 5 +++-- uip/scan.c | 5 ++--- uip/scansbr.c | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/h/scansbr.h b/h/scansbr.h index 4e2e87a..18a9364 100644 --- a/h/scansbr.h +++ b/h/scansbr.h @@ -24,4 +24,4 @@ extern char *scanl; /* ** prototypes */ -int scan(FILE *, int, int, char *, int, int, int, int); +int scan(FILE *, int, int, char *, int, int, int); diff --git a/uip/inc.c b/uip/inc.c index 2297a03..6546cea 100644 --- a/uip/inc.c +++ b/uip/inc.c @@ -388,8 +388,9 @@ main(int argc, char **argv) } /* create scanline for new message */ - switch (incerr = scan(in, msgnum + 1, msgnum + 1, nfs, width, - msgnum == hghnum && chgflag, 1, noisy)) { + switch (incerr = scan(in, msgnum + 1, msgnum + 1, + noisy ? nfs : NULL, width, + msgnum == hghnum && chgflag, 1)) { case SCNFAT: case SCNEOF: break; diff --git a/uip/scan.c b/uip/scan.c index ef13e39..6fbd579 100644 --- a/uip/scan.c +++ b/uip/scan.c @@ -127,7 +127,7 @@ main(int argc, char **argv) m_unknown(in); for (msgnum = 1; ; ++msgnum) { - state = scan(in, msgnum, -1, nfs, width, 0, 0, 1); + state = scan(in, msgnum, -1, nfs, width, 0, 0); if (state != SCNMSG) break; } @@ -206,8 +206,7 @@ main(int argc, char **argv) } switch (state = scan(in, msgnum, 0, nfs, width, - msgnum == mp->curmsg, unseen, - 1)) { + msgnum == mp->curmsg, unseen)) { case SCNMSG: case SCNERR: break; diff --git a/uip/scansbr.c b/uip/scansbr.c index 1c68bc2..69f385a 100644 --- a/uip/scansbr.c +++ b/uip/scansbr.c @@ -68,7 +68,7 @@ int sc_width(void); /* from termsbr.c */ int scan(FILE *inb, int innum, int outnum, char *nfs, int width, int curflg, - int unseen, int noisy) + int unseen) { int i, compnum, state; unsigned char *cp, *tmpbuf; @@ -328,7 +328,7 @@ finished: if (bodycomp) bodycomp->c_text = saved_c_text; - if (noisy) + if (nfs) fputs(scanl, stdout); /* return dynamically allocated buffers to pool */ -- 1.7.10.4