diff options
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/io.c | 14 | ||||
-rw-r--r-- | mbbsd/telnet.c | 4 |
2 files changed, 17 insertions, 1 deletions
@@ -165,6 +165,8 @@ add_io(int fd, int timeout) int num_in_buf(void) { + if (ibufsize <= icurrchar) + return 0; return ibufsize - icurrchar; } @@ -267,6 +269,15 @@ dogetch(void) currutmp->lastact = now; lastact = now; } + + // CR LF are treated as one. + if (inbuf[icurrchar] == Ctrl('M')) + { + if (++icurrchar < ibufsize && + inbuf[icurrchar] == Ctrl('J')) + icurrchar ++; + return Ctrl('M'); + } return (unsigned char)inbuf[icurrchar++]; } @@ -626,6 +637,8 @@ igetch(void) } return ch; + // try to do this in getch() level. +#if 0 case Ctrl('J'): /* Ptt �� \n ���� */ #ifdef PLAY_ANGEL /* Seams some telnet client still send CR LF when changing lines. @@ -633,6 +646,7 @@ igetch(void) */ #endif continue; +#endif default: return ch; diff --git a/mbbsd/telnet.c b/mbbsd/telnet.c index 4f4bba0b..332b3f3a 100644 --- a/mbbsd/telnet.c +++ b/mbbsd/telnet.c @@ -164,7 +164,9 @@ telnet_handler(unsigned char c) iac_state = IAC_NONE; /* by default we restore state. */ switch(c) { case IAC: - return 0; + // return 0; + // we don't want to allow IACs as input. + return 1; /* we don't want to process these. or maybe in future. */ case BREAK: /* break */ |