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 */
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];
#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;
/*
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
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'))
}
/* 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);