correct buffering

This commit is contained in:
Matthias-Christian Ott 2008-06-15 09:19:22 +02:00
parent cf147ae9da
commit 3cb6793781

13
std.c
View file

@ -85,7 +85,7 @@ movea(int x, int y) {
y = MAX(y, lines); y = MAX(y, lines);
cx = x; cx = x;
cy = y; cy = y;
cmd("s %d,%d", x, y); cmd("seek(%d,%d)", x, y);
} }
void void
@ -186,10 +186,10 @@ parseesc(void) {
case 0: case 0:
case 22: case 22:
if(bold) if(bold)
cmd("b"); cmd("bold");
case 1: case 1:
if(!bold) if(!bold)
cmd("b"); cmd("bold");
break; break;
} }
} }
@ -204,7 +204,7 @@ parseesc(void) {
void void
scroll(int l) { scroll(int l) {
cmd("s %d, %d", cx, cy + l); cmd("seek(%d,%d)", cx, cy + l);
} }
void void
@ -279,7 +279,8 @@ main(int argc, char *argv[]) {
r = select(ptm + 1, &rfds, NULL, NULL, NULL); r = select(ptm + 1, &rfds, NULL, NULL, NULL);
if(r == -1) if(r == -1)
eprintn("error, cannot select"); eprintn("error, cannot select");
if(FD_ISSET(ptm, &rfds)) { if(FD_ISSET(ptm, &rfds))
do {
c = getch(); c = getch();
switch(c) { switch(c) {
case '\033': case '\033':
@ -289,7 +290,7 @@ main(int argc, char *argv[]) {
putchar(c); putchar(c);
} }
fflush(stdout); fflush(stdout);
} } while(rbuf.i < rbuf.n);
} }
return 0; return 0;
} }