delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/1998/12/02/16:27:15

From: corinna DOT vinschen AT cityweb DOT de (Corinna Vinschen)
Subject: B20 patch: CR handling in fhandler_console
2 Dec 1998 16:27:15 -0800 :
Message-ID: <3665D672.A1722461.cygnus.cygwin32.developers@cityweb.de>
Mime-Version: 1.0
To: cygwin32-developers AT cygnus DOT com

Hallo,

in fhandler_console::read1() a short piece of code
ignores CR if it is the one and only char in console input.

I have found no circumstance, in which this code makes sense.
On the other hand: If a process turns stdin into raw mode and
then again into cooked mode, only a single CR is generated by
the return key. In this case, the above mentioned code leads
to the situation, that a getchar doesn't return, if one only
presses the return key! 

I want to suggest to kill the mentioned code piece, if nobody
offers a convincing reason to let it in.

Regards,
Corinna

ChangeLog:
----------
Wed Dec  2 23:40:00 1998  Corinna Vinschen <corinna DOT vinschen AT cityweb DOT de>

        * fhandler_console.cc (fhandler_console::read1):
        Deleted code for ignoring sinle CR.


Index: fhandler_console.cc
===================================================================
RCS file: /src/cvsroot/winsup-981126/fhandler_console.cc,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- fhandler_console.cc 1998/11/30 00:48:52     1.2
+++ fhandler_console.cc 1998/12/02 23:38:50     1.3
@@ -1164,12 +1164,14 @@ fhandler_console::read1 (char *buf, size
                continue;
              memcpy (buf, buf + 1, copied_chars);
            }
+#if 0
          /* If just one character read and it is a \r loop, waiting for a \n. */
          if (copied_chars == 1)
            {
              if (buf[0] == '\r')
                continue;
            }
+#endif
          /* Perform a similar test on a buffer with > 1 character.  If it ends in
             \r\n then fix it up. */
          else if (buf[copied_chars - 1] == '\n' && buf[copied_chars - 2] == '\r')

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019