Common stdio implementations flush stdout-on-TTY automatically on newline.
int
main(int argc, char **argv)
{
- int ontty;
int width = 0;
int i, state, msgnum;
int seqnum[NUMATTRS], unseen, num_unseen_seq = 0;
}
}
- 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) {
break;
}
fclose(in);
- if (ontty)
- fflush(stdout);
}
}