does NOT meet the telnet spec (it sends CR with no following LF or NULL),
but we follow the spec even if we keep compatibility.
SCCS-vsn: libexec/telnetd/telnetd.c 5.7
#endif not lint
#ifndef lint
#endif not lint
#ifndef lint
-static char sccsid[] = "@(#)telnetd.c 5.6 (Berkeley) %G%";
+static char sccsid[] = "@(#)telnetd.c 5.7 (Berkeley) %G%";
case TS_CR:
state = TS_DATA;
case TS_CR:
state = TS_DATA;
- if (c == 0) {
- *pfrontp++ = '\r';
+ if ((c == 0) || (c == '\n')) {
- } else if (c == '\n') {
- *pfrontp++ = c;
- break;
- } else
- *pfrontp++ = '\r';
/* FALL THROUGH */
case TS_DATA:
/* FALL THROUGH */
case TS_DATA:
- if (!myopts[TELOPT_BINARY] && c == '\r')
+ if (!myopts[TELOPT_BINARY] && c == '\r') {