aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias-Christian Ott <ott@enolink.de>2008-06-15 17:31:24 +0200
committerMatthias-Christian Ott <ott@enolink.de>2008-06-15 17:31:24 +0200
commitf757e6f839414c5f7aee5553d6a9417348b8ff43 (patch)
tree4e8137c2e39001d35b09a050a62b62297a2f1cd3
parentdadd3d0a6d94cce5ab9291c9698b8c4098d3fa69 (diff)
downloadst-f757e6f839414c5f7aee5553d6a9417348b8ff43.tar.gz
st-f757e6f839414c5f7aee5553d6a9417348b8ff43.tar.bz2
simplify flushing
-rw-r--r--std.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/std.c b/std.c
index b0142fe..84048e4 100644
--- a/std.c
+++ b/std.c
@@ -279,7 +279,7 @@ main(int argc, char *argv[]) {
r = select(ptm + 1, &rfds, NULL, NULL, NULL);
if(r == -1)
eprintn("error, cannot select");
- if(FD_ISSET(ptm, &rfds))
+ if(FD_ISSET(ptm, &rfds)) {
do {
c = getch();
switch(c) {
@@ -289,8 +289,9 @@ main(int argc, char *argv[]) {
default:
putchar(c);
}
- fflush(stdout);
} while(rbuf.i < rbuf.n);
+ fflush(stdout);
+ }
}
return 0;
}