SCCS-vsn: libexec/telnetd/telnetd.c 5.8
#endif not lint
#ifndef lint
#endif not lint
#ifndef lint
-static char sccsid[] = "@(#)telnetd.c 5.7 (Berkeley) %G%";
+static char sccsid[] = "@(#)telnetd.c 5.8 (Berkeley) %G%";
if (c == IAC)
*nfrontp++ = c;
*nfrontp++ = c;
if (c == IAC)
*nfrontp++ = c;
*nfrontp++ = c;
+ if (c == '\r') {
+ if (pcc > 0 && ((*ptyip & 0377) == '\n')) {
+ *nfrontp++ = *ptyip++ & 0377;
+ pcc--;
+ } else
+ *nfrontp++ = '\0';
+ }
}
if ((obits & (1 << f)) && (nfrontp - nbackp) > 0)
netflush();
}
if ((obits & (1 << f)) && (nfrontp - nbackp) > 0)
netflush();
+ /*
+ * We map \r\n ==> \n, since \r\n says
+ * that we want to be in column 1 of the next
+ * printable line, and \n is the standard
+ * unix way of saying that (\r is only good
+ * if CRMOD is set, which it normally is).
+ */
if (!myopts[TELOPT_BINARY] && c == '\r') {
if (!myopts[TELOPT_BINARY] && c == '\r') {
+ if ((ncc > 0) && ('\n' == *netip)) {
+ netip++; ncc--;
+ c = '\n';
+ } else {
+ state = TS_CR;
+ }