Skip to content

Commit

Permalink
Remove CON_FlushIn function and where STDIN needs flushing, use tcflu…
Browse files Browse the repository at this point in the history
…sh POSIX function
  • Loading branch information
Tom Murphy authored and timangus committed Mar 14, 2018
1 parent b48d902 commit af6b1f8
Showing 1 changed file with 3 additions and 17 deletions.
20 changes: 3 additions & 17 deletions code/sys/con_tty.c
Expand Up @@ -73,20 +73,6 @@ static int hist_current = -1, hist_count = 0;
#define TTY_CONSOLE_PROMPT "]"
#endif

/*
==================
CON_FlushIn
Flush stdin, I suspect some terminals are sending a LOT of shit
FIXME relevant?
==================
*/
static void CON_FlushIn( void )
{
char key;
while (read(STDIN_FILENO, &key, 1)!=-1);
}

/*
==================
CON_Back
Expand Down Expand Up @@ -441,7 +427,7 @@ char *CON_Input( void )
TTY_con = *history;
CON_Show();
}
CON_FlushIn();
tcflush(STDIN_FILENO, TCIFLUSH);
return NULL;
break;
case 'B':
Expand All @@ -455,7 +441,7 @@ char *CON_Input( void )
Field_Clear(&TTY_con);
}
CON_Show();
CON_FlushIn();
tcflush(STDIN_FILENO, TCIFLUSH);
return NULL;
break;
case 'C':
Expand All @@ -467,7 +453,7 @@ char *CON_Input( void )
}
}
Com_DPrintf("droping ISCTL sequence: %d, TTY_erase: %d\n", key, TTY_erase);
CON_FlushIn();
tcflush(STDIN_FILENO, TCIFLUSH);
return NULL;
}
if (TTY_con.cursor >= sizeof(text) - 1)
Expand Down

0 comments on commit af6b1f8

Please sign in to comment.