X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/putty/blobdiff_plain/8f22582cf466052917dad28301545cfa60db76e8..f21d1674c6cd193198907ae82738fe22983ba869:/ldisc.c diff --git a/ldisc.c b/ldisc.c index e1b5a389..e464c131 100644 --- a/ldisc.c +++ b/ldisc.c @@ -61,7 +61,7 @@ static void bsb(int n) #define CTRL(x) (x^'@') #define KCTRL(x) ((x^'@') | 0x100) -void ldisc_send(char *buf, int len) +void ldisc_send(char *buf, int len, int interactive) { int keyflag = 0; /* @@ -86,6 +86,8 @@ void ldisc_send(char *buf, int len) while (len--) { int c; c = *buf++ + keyflag; + if (!interactive && c == '\r') + c += KCTRL('@'); switch (term_quotenext ? ' ' : c) { /* * ^h/^?: delete one char and output one BSB @@ -130,6 +132,13 @@ void ldisc_send(char *buf, int len) term_buflen--; } back->special(TS_EL); + /* + * We don't send IP, SUSP or ABORT if the user has + * configured telnet specials off! This breaks + * talkers otherwise. + */ + if (!cfg.telnet_keyboard) + goto default_case; if (c == CTRL('C')) back->special(TS_IP); if (c == CTRL('Z')) @@ -202,6 +211,7 @@ void ldisc_send(char *buf, int len) } /* FALLTHROUGH */ default: /* get to this label from ^V handler */ + default_case: if (term_buflen >= term_bufsiz) { term_bufsiz = term_buflen + 256; term_buf = saferealloc(term_buf, term_bufsiz);