--- winsup/cygwin/include/sys/termios.h.orig Sun Mar 25 22:09:52 2001 +++ winsup/cygwin/include/sys/termios.h Mon Mar 4 16:45:38 2002 @@ -195,6 +195,14 @@ #define NCCS 18 +/* `c_cc' member of 'struct termios' structure can be disabled by + using the value _POSIX_VDISABLE. */ +#define _POSIX_VDISABLE '\0' + +/* Compare a character C to a value VAL from the `c_cc' array in a + `struct termios'. If VAL is _POSIX_VDISABLE, no character can match it. */ +#define CCEQ(val, c) ((c) == (val) && (val) != _POSIX_VDISABLE) + typedef unsigned char cc_t; typedef unsigned int tcflag_t; typedef unsigned int speed_t; --- winsup/cygwin/fhandler_termios.cc.orig Sun Aug 26 03:41:58 2001 +++ winsup/cygwin/fhandler_termios.cc Mon Mar 4 16:51:16 2002 @@ -9,6 +9,7 @@ details. */ #include "winsup.h" +#include #include #include #include @@ -207,11 +208,11 @@ if (tc->ti.c_lflag & ISIG) { int sig; - if (c == tc->ti.c_cc[VINTR]) + if (CCEQ(tc->ti.c_cc[VINTR], c)) sig = SIGINT; - else if (c == tc->ti.c_cc[VQUIT]) + else if (CCEQ(tc->ti.c_cc[VQUIT], c)) sig = SIGQUIT; - else if (c == tc->ti.c_cc[VSUSP]) + else if (CCEQ(tc->ti.c_cc[VSUSP], c)) sig = SIGTSTP; else goto not_a_sig; @@ -226,7 +227,7 @@ not_a_sig: if (tc->ti.c_iflag & IXON) { - if (c == tc->ti.c_cc[VSTOP]) + if (CCEQ(tc->ti.c_cc[VSTOP], c)) { if (!tc->output_stopped) { @@ -235,7 +236,7 @@ } continue; } - else if (c == tc->ti.c_cc[VSTART]) + else if (CCEQ(tc->ti.c_cc[VSTART], c)) { restart_output: tc->output_stopped = 0; @@ -245,20 +246,20 @@ else if ((tc->ti.c_iflag & IXANY) && tc->output_stopped) goto restart_output; } - if (tc->ti.c_lflag & IEXTEN && c == tc->ti.c_cc[VDISCARD]) + if (iscanon && tc->ti.c_lflag & IEXTEN && CCEQ(tc->ti.c_cc[VDISCARD], c)) { tc->ti.c_lflag ^= FLUSHO; continue; } if (!iscanon) /* nothing */; - else if (c == tc->ti.c_cc[VERASE]) + else if (CCEQ(tc->ti.c_cc[VERASE], c)) { if (eat_readahead (1)) echo_erase (); continue; } - else if (c == tc->ti.c_cc[VWERASE]) + else if (CCEQ(tc->ti.c_cc[VWERASE], c)) { int ch; do @@ -269,7 +270,7 @@ while ((ch = peek_readahead (1)) >= 0 && !isspace (ch)); continue; } - else if (c == tc->ti.c_cc[VKILL]) + else if (CCEQ(tc->ti.c_cc[VKILL], c)) { int nchars = eat_readahead (-1); if (tc->ti.c_lflag & ECHO) @@ -277,7 +278,7 @@ echo_erase (1); continue; } - else if (c == tc->ti.c_cc[VREPRINT]) + else if (CCEQ(tc->ti.c_cc[VREPRINT], c)) { if (tc->ti.c_lflag & ECHO) { @@ -286,14 +287,14 @@ } continue; } - else if (c == tc->ti.c_cc[VEOF]) + else if (CCEQ(tc->ti.c_cc[VEOF], c)) { termios_printf ("EOF"); input_done = 1; continue; } - else if (c == tc->ti.c_cc[VEOL] || - c == tc->ti.c_cc[VEOL2] || + else if (CCEQ(tc->ti.c_cc[VEOL], c) || + CCEQ(tc->ti.c_cc[VEOL2], c) || c == '\n') { set_input_done (1);