[PATCH] termios accept_input

Steve O bub@io.com
Mon Dec 9 22:12:00 GMT 2002


Hi,
Sorry for the delay in submitting this patch.  This moves the
accept_input() call into the character processing loop where
it can fail and be recovered from.  It should have no behavioral
effect.

Thanks,
-steve

ChangeLog
2002-12-09  Steve Osborn  <bub@io.com>

	* fhandler_termios.cc (fhandler_termios::line_edit): Call
	accept_input() in character processing loop.  Set return 
	value independently of input_done.

-------------- next part --------------
Index: cygwin/fhandler_termios.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/fhandler_termios.cc,v
retrieving revision 1.34
diff -u -p -r1.34 fhandler_termios.cc
--- cygwin/fhandler_termios.cc	5 Dec 2002 16:24:52 -0000	1.34
+++ cygwin/fhandler_termios.cc	10 Dec 2002 05:43:43 -0000
@@ -308,7 +308,8 @@ fhandler_termios::line_edit (const char 
       else if (CCEQ (tc->ti.c_cc[VEOF], c))
 	{
 	  termios_printf ("EOF");
-	  input_done = 1;
+	  (void) accept_input();
+	  ret = line_edit_input_done;
 	  continue;
 	}
       else if (CCEQ (tc->ti.c_cc[VEOL], c) ||
@@ -323,20 +324,21 @@ fhandler_termios::line_edit (const char 
 	c = cyg_tolower (c);
 
       put_readahead (c);
+      if (!iscanon || always_accept || input_done)
+	{
+	  (void) accept_input();
+	  ret = line_edit_input_done;
+	  input_done = 0;
+	}
       if (tc->ti.c_lflag & ECHO)
 	doecho (&c, 1);
     }
 
-  if (!iscanon || always_accept)
-    set_input_done (ralen > 0);
+  if ((!iscanon || always_accept) && ralen > 0)
+    ret = line_edit_input_done;
 
   if (sawsig)
     ret = line_edit_signalled;
-  else if (input_done)
-    {
-      ret = line_edit_input_done;
-      (void) accept_input ();
-    }
 
   return ret;
 }


More information about the Cygwin-patches mailing list