From dfb4cc611bde166e56cae44c3ab389ba1bcbc2a5 Mon Sep 17 00:00:00 2001 From: epoch Date: Mon, 15 Jan 2018 03:00:12 -0600 Subject: added a counter to at least draw the screen every 100 lines read from stdin --- src/hackvr.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/hackvr.c b/src/hackvr.c index 7ae6616..12a35b3 100644 --- a/src/hackvr.c +++ b/src/hackvr.c @@ -90,6 +90,7 @@ int load_stdin() {//this function returns -1 to quit, 0 to not ask for a redraw, int len; int ret=0; int j,k,l; + int counter; //struct timeval timeout; //fd_set master; //fd_set readfs; @@ -115,7 +116,11 @@ int load_stdin() {//this function returns -1 to quit, 0 to not ask for a redraw, } if(FD_ISSET(0,&readfs)) {*/ //#endif - while((line=line?free(line),read_line_hack(stdin,0):read_line_hack(stdin,0))) {//load as long there's something to load + counter=0; + for(counter=0;counter < 100 && (line=line?free(line),read_line_hack(stdin,0):read_line_hack(stdin,0));counter++) {//load as long there's something to load + //but doing this will make it not ever redraw the screen as long as there's more to read. + //how do we compensate for this? an alarm that will break us out? + //a counter that will break us out? if(*line == '#') continue; // fprintf(stderr,"# read command: %s\n",line); if(a) free(a);//use a static char pointer array so I don't have to use the heap. possible optimization. -- cgit v1.2.3