1
0

only disable terminal echoing if peek wont die

This commit is contained in:
dtb 2023-12-15 21:19:01 -07:00
parent 8cd268317f
commit 7d08978808

View File

@ -21,11 +21,6 @@ int main(int argc, char *argv[]){
int p[2] = {0, 0};
struct termios t;
/* terminal echo */
tcgetattr(STDIN_FILENO, &t);
t.c_lflag ^= ECHO;
tcsetattr(STDIN_FILENO, TCSAFLUSH, &t);
if(argc < 1)
goto usage;
@ -74,6 +69,11 @@ usage: fprintf(stderr, "Usage: %s (-1eno)"
goto die;
}
/* terminal echo */
tcgetattr(STDIN_FILENO, &t);
t.c_lflag ^= ECHO;
tcsetattr(STDIN_FILENO, TCSAFLUSH, &t);
do{ if((c = getc(stdin)) != eof || include_eof)
for(i = 0; i < (sizeof outputs)/(sizeof *outputs); ++i)
if(outputs[i] != 0