]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Disable a bunch of undesirable termios flags. ICRNL, in particular,
authorSimon Tatham <anakin@pobox.com>
Tue, 3 Oct 2006 17:16:26 +0000 (17:16 +0000)
committerSimon Tatham <anakin@pobox.com>
Tue, 3 Oct 2006 17:16:26 +0000 (17:16 +0000)
is liable to have been set on serial ports previously used as
terminal devices, and definitely wants not to be set on serial ports
being used for callout.

[originally from svn r6865]

unix/uxser.c

index 463f4c43f7952d25a1bf29da5d7ab5f09fa1fc6a..d6471084d56fee296aa45e6a7e2399ff8113b6e9 100644 (file)
@@ -205,7 +205,16 @@ static const char *serial_configure(Serial serial, Config *cfg)
 
     options.c_cflag |= CLOCAL | CREAD;
     options.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG);
-    options.c_oflag &= ~OPOST;
+    options.c_iflag &= ~(ISTRIP | IGNCR | INLCR | ICRNL
+#ifdef IUCLC
+                        | IUCLC
+#endif
+                        );
+    options.c_oflag &= ~(OPOST
+#ifdef ONLCR
+                        | ONLCR
+#endif
+                        | OCRNL | ONOCR | ONLRET);
     options.c_cc[VMIN] = 1;
     options.c_cc[VTIME] = 0;