summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authormarkm <markm@FreeBSD.org>2002-12-29 07:36:43 +0000
committermarkm <markm@FreeBSD.org>2002-12-29 07:36:43 +0000
commit2257328643d73694512ad1b67819eda596ca0968 (patch)
tree09434ea7e25abdfce1390fb8889ab2f3d8a601af /usr.bin
parent3f894298eb82eef78555e22106110a497e5813cf (diff)
downloadFreeBSD-src-2257328643d73694512ad1b67819eda596ca0968.zip
FreeBSD-src-2257328643d73694512ad1b67819eda596ca0968.tar.gz
Diff-reduction WRT crypto telnet; replace "#if 0" code removed by an
earlier invocation of unifdef(1).
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/telnet/telnet.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/usr.bin/telnet/telnet.c b/usr.bin/telnet/telnet.c
index 9971152..27aeaa9 100644
--- a/usr.bin/telnet/telnet.c
+++ b/usr.bin/telnet/telnet.c
@@ -1946,6 +1946,47 @@ telnet(char *user __unusedhere)
}
}
+#if 0 /* XXX - this not being in is a bug */
+/*
+ * nextitem()
+ *
+ * Return the address of the next "item" in the TELNET data
+ * stream. This will be the address of the next character if
+ * the current address is a user data character, or it will
+ * be the address of the character following the TELNET command
+ * if the current address is a TELNET IAC ("I Am a Command")
+ * character.
+ */
+
+static char *
+nextitem(char *current)
+{
+ if ((*current&0xff) != IAC) {
+ return current+1;
+ }
+ switch (*(current+1)&0xff) {
+ case DO:
+ case DONT:
+ case WILL:
+ case WONT:
+ return current+3;
+ case SB: /* loop forever looking for the SE */
+ {
+ char *look = current+2;
+
+ for (;;) {
+ if ((*look++&0xff) == IAC) {
+ if ((*look++&0xff) == SE) {
+ return look;
+ }
+ }
+ }
+ }
+ default:
+ return current+2;
+ }
+}
+#endif /* 0 */
/*
* netclear()
OpenPOWER on IntegriCloud