scan: Don't fflush manually. Let stdio care for this.
authormarkus schnalke <meillo@marmaro.de>
Fri, 10 Feb 2012 11:00:28 +0000 (12:00 +0100)
committermarkus schnalke <meillo@marmaro.de>
Fri, 10 Feb 2012 11:00:28 +0000 (12:00 +0100)
Common stdio implementations flush stdout-on-TTY automatically on newline.

uip/scan.c

index 1b58eb5..d5cc50f 100644 (file)
@@ -31,7 +31,6 @@ static struct swit switches[] = {
 int
 main(int argc, char **argv)
 {
-       int ontty;
        int width = 0;
        int i, state, msgnum;
        int seqnum[NUMATTRS], unseen, num_unseen_seq = 0;
@@ -188,8 +187,6 @@ main(int argc, char **argv)
                }
        }
 
-       ontty = isatty(fileno(stdout));
-
        for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) {
                if (is_selected(mp, msgnum)) {
                        if ((in = fopen(cp = m_name(msgnum), "r")) == NULL) {
@@ -225,8 +222,6 @@ main(int argc, char **argv)
                                break;
                        }
                        fclose(in);
-                       if (ontty)
-                               fflush(stdout);
                }
        }