projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix for carriage return (from userid <borman>).
[unix-history]
/
usr
/
src
/
libexec
/
telnetd
/
telnetd.c
diff --git
a/usr/src/libexec/telnetd/telnetd.c
b/usr/src/libexec/telnetd/telnetd.c
index
0e1320a
..
d020f16
100644
(file)
--- a/
usr/src/libexec/telnetd/telnetd.c
+++ b/
usr/src/libexec/telnetd/telnetd.c
@@
-11,7
+11,7
@@
char copyright[] =
#endif not lint
#ifndef lint
#endif not lint
#ifndef lint
-static char sccsid[] = "@(#)telnetd.c 5.
5
(Berkeley) %G%";
+static char sccsid[] = "@(#)telnetd.c 5.
6
(Berkeley) %G%";
#endif not lint
/*
#endif not lint
/*
@@
-296,6
+296,18
@@
telrcv()
c = *netip++ & 0377, ncc--;
switch (state) {
c = *netip++ & 0377, ncc--;
switch (state) {
+ case TS_CR:
+ state = TS_DATA;
+ if (c == 0) {
+ *pfrontp++ = '\r';
+ break;
+ } else if (c == '\n') {
+ *pfrontp++ = c;
+ break;
+ } else
+ *pfrontp++ = '\r';
+ /* FALL THROUGH */
+
case TS_DATA:
if (c == IAC) {
state = TS_IAC;
case TS_DATA:
if (c == IAC) {
state = TS_IAC;
@@
-303,15
+315,10
@@
telrcv()
}
if (inter > 0)
break;
}
if (inter > 0)
break;
- *pfrontp++ = c;
if (!myopts[TELOPT_BINARY] && c == '\r')
state = TS_CR;
if (!myopts[TELOPT_BINARY] && c == '\r')
state = TS_CR;
- break;
-
- case TS_CR:
- if (c && c != '\n')
+ else
*pfrontp++ = c;
*pfrontp++ = c;
- state = TS_DATA;
break;
case TS_IAC:
break;
case TS_IAC: