Noux: initialize the 'termios' structure

Fixes #614.
This commit is contained in:
Christian Prochaska 2013-01-14 16:43:40 +01:00 committed by Norman Feske
parent 59e0dc3538
commit f109f4b02d

View File

@ -949,11 +949,18 @@ namespace {
PDBG("TIOCGETA - argp=0x%p", argp);
::termios *termios = (::termios *)argp;
termios->c_iflag = 0;
termios->c_oflag = 0;
termios->c_cflag = 0;
/*
* Set 'ECHO' flag, needed by libreadline. Otherwise, echoing
* user input doesn't work in bash.
*/
termios->c_lflag = ECHO;
memset(termios->c_cc, _POSIX_VDISABLE, sizeof(termios->c_cc));
termios->c_ispeed = 0;
termios->c_ospeed = 0;
return 0;
}