only disable terminal echoing if peek wont die
This commit is contained in:
parent
8cd268317f
commit
7d08978808
10
peek/peek.c
10
peek/peek.c
@ -21,11 +21,6 @@ int main(int argc, char *argv[]){
|
|||||||
int p[2] = {0, 0};
|
int p[2] = {0, 0};
|
||||||
struct termios t;
|
struct termios t;
|
||||||
|
|
||||||
/* terminal echo */
|
|
||||||
tcgetattr(STDIN_FILENO, &t);
|
|
||||||
t.c_lflag ^= ECHO;
|
|
||||||
tcsetattr(STDIN_FILENO, TCSAFLUSH, &t);
|
|
||||||
|
|
||||||
if(argc < 1)
|
if(argc < 1)
|
||||||
goto usage;
|
goto usage;
|
||||||
|
|
||||||
@ -74,6 +69,11 @@ usage: fprintf(stderr, "Usage: %s (-1eno)"
|
|||||||
goto die;
|
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)
|
do{ if((c = getc(stdin)) != eof || include_eof)
|
||||||
for(i = 0; i < (sizeof outputs)/(sizeof *outputs); ++i)
|
for(i = 0; i < (sizeof outputs)/(sizeof *outputs); ++i)
|
||||||
if(outputs[i] != 0
|
if(outputs[i] != 0
|
||||||
|
Loading…
Reference in New Issue
Block a user