summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-09-23 00:04:54 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-09-23 00:04:54 +0800
commit59382a53ad9a87fcff1911be65d68e97099bbd90 (patch)
tree5c14e8a909885e50a01a821b4eb1e5eadd5a3fa0
parent6a96546a014efc705aebcc1fc6ca23448df23d26 (diff)
downloadpttbbs-59382a53ad9a87fcff1911be65d68e97099bbd90.tar
pttbbs-59382a53ad9a87fcff1911be65d68e97099bbd90.tar.gz
pttbbs-59382a53ad9a87fcff1911be65d68e97099bbd90.tar.bz2
pttbbs-59382a53ad9a87fcff1911be65d68e97099bbd90.tar.lz
pttbbs-59382a53ad9a87fcff1911be65d68e97099bbd90.tar.xz
pttbbs-59382a53ad9a87fcff1911be65d68e97099bbd90.tar.zst
pttbbs-59382a53ad9a87fcff1911be65d68e97099bbd90.zip
* fix DBCS detection: DEL is 0x7f not 0x1f
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4880 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--mbbsd/telnet.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/mbbsd/telnet.c b/mbbsd/telnet.c
index 933f9f3c..22ad6234 100644
--- a/mbbsd/telnet.c
+++ b/mbbsd/telnet.c
@@ -53,11 +53,18 @@ dbcs_detect_evil_repeats(unsigned char *buf, ssize_t l)
// XXX l=2 is dangerous. hope we are not in telnet IAC state...
// BS: \b
// BS2: \x7f
+ // DEL2: Ctrl('D') (KKMan3 also treats Ctrl('D') as DBCS DEL)
if (buf[0] != buf[1])
return l;
+ // Note: BS/DEL behavior on different clients:
+ // screen/telnet:BS=0x7F, DEL=^[3~
+ // PCMan2004: BS=0x7F, DEL=^[3~
+ // KKMan3: BS=0x1b, DEL=0x7F
+ // WinXP telnet: BS=0x1b, DEL=0x7F
if (buf[0] == '\b' ||
- buf[0] == '\x1f')
+ buf[0] == '\x7f' ||
+ buf[0] == Ctrl('D'))
return l-1;
}
else if (l == 6)