Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2002-03-05 11:15:28 +0300
committerCorinna Vinschen <corinna@vinschen.de>2002-03-05 11:15:28 +0300
commitad2864f4c8dd5157dad2011483c4076416a80f4c (patch)
tree91247897fcc07860d690839224fc1314fb2e225b /winsup/cygwin/fhandler_termios.cc
parent8cd4824313b12ec2b243bd4cc8c0b4bc5b2f796d (diff)
* include/sys/termios.h: Define _POSIX_VDISABLE. Define CCEQ macro.
* fhandler_termios.cc: Include <sys/termios.h>. (line_edit): Recognize disabled c_cc[] chars. Ignore VDISCARD when not in ICANON mode.
Diffstat (limited to 'winsup/cygwin/fhandler_termios.cc')
-rw-r--r--winsup/cygwin/fhandler_termios.cc27
1 files changed, 14 insertions, 13 deletions
diff --git a/winsup/cygwin/fhandler_termios.cc b/winsup/cygwin/fhandler_termios.cc
index 2407238e7..fb8c2e09f 100644
--- a/winsup/cygwin/fhandler_termios.cc
+++ b/winsup/cygwin/fhandler_termios.cc
@@ -9,6 +9,7 @@ Cygwin license. Please consult the file "CYGWIN_LICENSE" for
details. */
#include "winsup.h"
+#include <sys/termios.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
@@ -226,11 +227,11 @@ fhandler_termios::line_edit (const char *rptr, int nread, int always_accept)
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;
@@ -245,7 +246,7 @@ fhandler_termios::line_edit (const char *rptr, int nread, int always_accept)
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)
{
@@ -254,7 +255,7 @@ fhandler_termios::line_edit (const char *rptr, int nread, int always_accept)
}
continue;
}
- else if (c == tc->ti.c_cc[VSTART])
+ else if (CCEQ(tc->ti.c_cc[VSTART], c))
{
restart_output:
tc->output_stopped = 0;
@@ -264,20 +265,20 @@ fhandler_termios::line_edit (const char *rptr, int nread, int always_accept)
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
@@ -288,7 +289,7 @@ fhandler_termios::line_edit (const char *rptr, int nread, int always_accept)
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)
@@ -296,7 +297,7 @@ fhandler_termios::line_edit (const char *rptr, int nread, int always_accept)
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)
{
@@ -305,14 +306,14 @@ fhandler_termios::line_edit (const char *rptr, int nread, int always_accept)
}
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);