X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/blobdiff_plain/ed554bc5e4201344d7eaad78263566e79428759c..fd88f5c5678c80ff5e338adc372d28a52ad20530:/Foreign/src/telnetd/state.c diff --git a/Foreign/src/telnetd/state.c b/Foreign/src/telnetd/state.c index c957734e71..e3cbb739f1 100644 --- a/Foreign/src/telnetd/state.c +++ b/Foreign/src/telnetd/state.c @@ -32,7 +32,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)state.c 8.2 (Berkeley) 12/15/93"; +static char sccsid[] = "@(#)state.c 8.5 (Berkeley) 5/30/95"; #endif /* not lint */ #include "telnetd.h" @@ -354,7 +354,7 @@ gotiac: switch (c) { char xbuf2[BUFSIZ]; register char *cp; int n = pfrontp - opfrontp, oc; - bcopy(opfrontp, xptyobuf, n); + memmove(xptyobuf, opfrontp, n); pfrontp = opfrontp; pfrontp += term_input(xptyobuf, pfrontp, n, BUFSIZ+NETSLOP, xbuf2, &oc, BUFSIZ); @@ -376,7 +376,7 @@ gotiac: switch (c) { * All state defaults are negative, and resp defaults to 0. * * When initiating a request to change state to new_state: - * + * * if ((want_resp == 0 && new_state == my_state) || want_state == new_state) { * do nothing; * } else { @@ -690,7 +690,6 @@ wontoption(option) */ if (lmodetype != REAL_LINEMODE) break; - lmodetype = KLUDGE_LINEMODE; # endif /* KLUDGELINEMODE */ clientstat(TELOPT_LINEMODE, WONT, 0); break; @@ -1446,8 +1445,8 @@ doclientstat() clientstat(TELOPT_LINEMODE, WILL, 0); } -#define ADD(c) *ncp++ = c; -#define ADD_DATA(c) { *ncp++ = c; if (c == SE) *ncp++ = c; } +#define ADD(c) *ncp++ = c +#define ADD_DATA(c) { *ncp++ = c; if (c == SE || c == IAC) *ncp++ = c; } void send_status() { @@ -1476,14 +1475,10 @@ send_status() if (my_want_state_is_will(i)) { ADD(WILL); ADD_DATA(i); - if (i == IAC) - ADD(IAC); } if (his_want_state_is_will(i)) { ADD(DO); ADD_DATA(i); - if (i == IAC) - ADD(IAC); } } @@ -1498,15 +1493,14 @@ send_status() ADD(SE); if (restartany >= 0) { - ADD(SB) + ADD(SB); ADD(TELOPT_LFLOW); if (restartany) { ADD(LFLOW_RESTART_ANY); } else { ADD(LFLOW_RESTART_XON); } - ADD(SE) - ADD(SB); + ADD(SE); } } @@ -1519,8 +1513,6 @@ send_status() ADD(TELOPT_LINEMODE); ADD(LM_MODE); ADD_DATA(editmode); - if (editmode == IAC) - ADD(IAC); ADD(SE); ADD(SB);