summaryrefslogtreecommitdiff
path: root/src/hackvr.c
diff options
context:
space:
mode:
authorepoch <epoch@hacking.allowed.org>2018-01-15 03:00:12 -0600
committerepoch <epoch@hacking.allowed.org>2018-01-15 03:00:12 -0600
commitdfb4cc611bde166e56cae44c3ab389ba1bcbc2a5 (patch)
tree7fde76e3a71ed9aa15cfc8804621f82ecf266399 /src/hackvr.c
parent6f53e1c175b3de184570893947c853b962ab715c (diff)
downloadhackvr-dfb4cc611bde166e56cae44c3ab389ba1bcbc2a5.tar.gz
hackvr-dfb4cc611bde166e56cae44c3ab389ba1bcbc2a5.zip
added a counter to at least draw the screen every 100 lines read from stdin
Diffstat (limited to 'src/hackvr.c')
-rw-r--r--src/hackvr.c7
1 files changed, 6 insertions, 1 deletions
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.