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:
authorChristopher Faylor <me@cgf.cx>2002-12-05 19:24:52 +0300
committerChristopher Faylor <me@cgf.cx>2002-12-05 19:24:52 +0300
commit49dd6fc61e991a533ae3f1167d48bb07b3391311 (patch)
treeadd58e9624eafa48ed31834cdfade456a4e0550f /winsup/cygwin/fhandler_termios.cc
parent94d815b251f6e5743f629aea73406fd9937feca3 (diff)
* fhandler.h (fhandler_termios::line_edit): Change return from an int to an
enum to allow the function to return an error. * fhandler_console.cc (fhandler_console::read): Update the line_edit call to use the new enum. * fhandler_termios.cc (fhandler_termios::line_edit): Change return from an int to an enum to allow the function to return an error. Put put_readahead call before doecho for future patch. * fhandler_tty.cc (fhandler_pty_master::write): Change to call line_edit one character at a time, and stop if an error occurs.
Diffstat (limited to 'winsup/cygwin/fhandler_termios.cc')
-rw-r--r--winsup/cygwin/fhandler_termios.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/winsup/cygwin/fhandler_termios.cc b/winsup/cygwin/fhandler_termios.cc
index cfdb1578f..6fa5cf984 100644
--- a/winsup/cygwin/fhandler_termios.cc
+++ b/winsup/cygwin/fhandler_termios.cc
@@ -186,9 +186,10 @@ fhandler_termios::echo_erase (int force)
doecho ("\b \b", 3);
}
-int
+line_edit_status
fhandler_termios::line_edit (const char *rptr, int nread, int always_accept)
{
+ line_edit_status ret = line_edit_ok;
char c;
int input_done = 0;
bool sawsig = FALSE;
@@ -321,20 +322,23 @@ fhandler_termios::line_edit (const char *rptr, int nread, int always_accept)
if (tc->ti.c_iflag & IUCLC && isupper (c))
c = cyg_tolower (c);
+ put_readahead (c);
if (tc->ti.c_lflag & ECHO)
doecho (&c, 1);
- put_readahead (c);
}
if (!iscanon || always_accept)
set_input_done (ralen > 0);
if (sawsig)
- input_done = -1;
+ ret = line_edit_signalled;
else if (input_done)
- (void) accept_input ();
+ {
+ ret = line_edit_input_done;
+ (void) accept_input ();
+ }
- return input_done;
+ return ret;
}
void