Fixed the mapping of \n to \r\n (from tty to network) whenever
authorGregory Minshall <minshall@ucbvax.Berkeley.EDU>
Wed, 28 May 1986 00:46:24 +0000 (16:46 -0800)
committerGregory Minshall <minshall@ucbvax.Berkeley.EDU>
Wed, 28 May 1986 00:46:24 +0000 (16:46 -0800)
CRMOD is true.

SCCS-vsn: usr.bin/telnet/telnet.c 5.16

usr/src/usr.bin/telnet/telnet.c

index 349b6d5..a988324 100644 (file)
@@ -11,7 +11,7 @@ char copyright[] =
 #endif not lint
 
 #ifndef lint
 #endif not lint
 
 #ifndef lint
-static char sccsid[] = "@(#)telnet.c   5.15 (Berkeley) %G%";
+static char sccsid[] = "@(#)telnet.c   5.16 (Berkeley) %G%";
 #endif not lint
 
 /*
 #endif not lint
 
 /*
@@ -964,10 +964,11 @@ telnet()
                        switch (c) {
                        case '\n':
                                /*
                        switch (c) {
                        case '\n':
                                /*
-                                * If echoing is happening locally,
-                                * then a newline (unix) is CRLF (TELNET).
+                                * If we are in CRMOD mode (\r ==> \n)
+                                * on our local machine, then probably
+                                * a newline (unix) is CRLF (TELNET).
                                 */
                                 */
-                               if (!hisopts[TELOPT_ECHO]) {
+                               if (globalmode >= 3) {
                                        NETADD('\r');
                                }
                                NETADD('\n');
                                        NETADD('\r');
                                }
                                NETADD('\n');