First phase of porting. pterm now compiles and runs under Linux+gtk.
[u/mdw/putty] / ldisc.c
diff --git a/ldisc.c b/ldisc.c
index e464c13..e6a110b 100644 (file)
--- a/ldisc.c
+++ b/ldisc.c
@@ -5,7 +5,6 @@
  * depending on what's currently configured.
  */
 
-#include <windows.h>
 #include <stdio.h>
 #include <ctype.h>
 
@@ -200,7 +199,7 @@ void ldisc_send(char *buf, int len, int interactive)
                        back->send(term_buf, term_buflen);
                    if (cfg.protocol == PROT_RAW)
                        back->send("\r\n", 2);
-                   else if (cfg.protocol == PROT_TELNET)
+                   else if (cfg.protocol == PROT_TELNET && cfg.telnet_newline)
                        back->special(TS_EOL);
                    else
                        back->send("\r", 1);
@@ -237,7 +236,10 @@ void ldisc_send(char *buf, int len, int interactive)
            if (keyflag && cfg.protocol == PROT_TELNET && len == 1) {
                switch (buf[0]) {
                  case CTRL('M'):
-                   back->special(TS_EOL);
+                   if (cfg.protocol == PROT_TELNET && cfg.telnet_newline)
+                       back->special(TS_EOL);
+                   else
+                       back->send("\r", 1);
                    break;
                  case CTRL('?'):
                  case CTRL('H'):