X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/putty/blobdiff_plain/4eeb7d098fc3c6fb29a4ba0da78edbf83f88dce1..8e3a513c3a264390dce084ef9cd0e3e9cb0bd5d2:/ldisc.c diff --git a/ldisc.c b/ldisc.c index 48fbe172..492ad1e0 100644 --- a/ldisc.c +++ b/ldisc.c @@ -28,7 +28,7 @@ static int term_buflen = 0, term_bufsiz = 0, term_quotenext = 0; static int plen(unsigned char c) { - if ((c >= 32 && c <= 126) || (c >= 160 && !utf)) + if ((c >= 32 && c <= 126) || (c >= 160 && !in_utf)) return 1; else if (c < 128) return 2; /* ^x for some x */ @@ -38,7 +38,7 @@ static int plen(unsigned char c) static void pwrite(unsigned char c) { - if ((c >= 32 && c <= 126) || (c >= 160 && !utf)) { + if ((c >= 32 && c <= 126) || (c >= 160 && !in_utf)) { c_write(&c, 1); } else if (c < 128) { char cc[2]; @@ -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