diff options
author | bde <bde@FreeBSD.org> | 2000-01-29 13:55:02 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 2000-01-29 13:55:02 +0000 |
commit | 62d970a531d897299092afd635208db8069feff1 (patch) | |
tree | a72788647b2794460047b15d9dee86ff9f998519 /contrib/ncurses | |
parent | 5a973d30653a0d2ce9d1bca438ae120ce1294ac2 (diff) | |
download | FreeBSD-src-62d970a531d897299092afd635208db8069feff1.zip FreeBSD-src-62d970a531d897299092afd635208db8069feff1.tar.gz |
Fixed IEXTEN handling in raw mode again. The effect of IEXTEN when
ICANON is off is implementation-defined. Under BSD, IEXTEN is
independent of ICANON, so it must be turned off to get "raw" mode.
This was first fixed in rev.1.4 (1995/10/21) of libncurses/lib_raw.c,
but the change was lost in the downgrade to the contrib version.
The fix here is the same as in the old rev.1.4, less style bugs. A
better fix would use cfmakeraw(3) to actually handle all of the
complications for switching to raw mode.
Diffstat (limited to 'contrib/ncurses')
-rw-r--r-- | contrib/ncurses/ncurses/tinfo/lib_raw.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/contrib/ncurses/ncurses/tinfo/lib_raw.c b/contrib/ncurses/ncurses/tinfo/lib_raw.c index 61b422c..f4d9909 100644 --- a/contrib/ncurses/ncurses/tinfo/lib_raw.c +++ b/contrib/ncurses/ncurses/tinfo/lib_raw.c @@ -31,6 +31,7 @@ * and: Eric S. Raymond <esr@snark.thyrsus.com> * ****************************************************************************/ +/* $FreeBSD$ */ /* * raw.c @@ -74,6 +75,10 @@ MODULE_ID("$Id: lib_raw.c,v 1.3 1999/03/06 22:28:24 tom Exp $") #define AFTER(s) #endif /* TRACE */ +#ifdef TERMIOS +static tcflag_t iexten = 0; +#endif + int raw(void) { T((T_CALLED("raw()"))); @@ -88,7 +93,9 @@ int raw(void) #ifdef TERMIOS BEFORE("raw"); - cur_term->Nttyb.c_lflag &= ~(ICANON|ISIG); + if (iexten == 0) + iexten = cur_term->Nttyb.c_lflag & IEXTEN; + cur_term->Nttyb.c_lflag &= ~(ICANON|ISIG|IEXTEN); cur_term->Nttyb.c_iflag &= ~(COOKED_INPUT); cur_term->Nttyb.c_cc[VMIN] = 1; cur_term->Nttyb.c_cc[VTIME] = 0; @@ -157,7 +164,7 @@ int noraw(void) #ifdef TERMIOS BEFORE("noraw"); - cur_term->Nttyb.c_lflag |= ISIG|ICANON; + cur_term->Nttyb.c_lflag |= ISIG|ICANON|iexten; cur_term->Nttyb.c_iflag |= COOKED_INPUT; AFTER("noraw"); #else |