From 81aedaf08d5fb34eddb2cf838a434aed1bfe3a6f Mon Sep 17 00:00:00 2001 From: piaip Date: Sun, 16 Dec 2007 04:43:32 +0000 Subject: - disable interupting ANSI inside DBCS characters (for UTF-8 or non-DBCS clients) git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3688 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/screen.c | 28 ++++++++++++++++++++++++++-- mbbsd/user.c | 2 ++ 2 files changed, 28 insertions(+), 2 deletions(-) (limited to 'mbbsd') diff --git a/mbbsd/screen.c b/mbbsd/screen.c index 8256ba5e..59e0addb 100644 --- a/mbbsd/screen.c +++ b/mbbsd/screen.c @@ -121,7 +121,8 @@ void redoscr(void) { register screenline_t *bp; - register int i, j, len; + register int i, j; + int len; o_clear(); for (tc_col = tc_line = i = 0, j = roll; i < scr_lns; i++, j++) { @@ -130,6 +131,17 @@ redoscr(void) bp = &big_picture[j]; if ((len = bp->len)) { rel_move(tc_col, tc_line, 0, i); + +#ifdef DBCSAWARE + if (!(bp->mode & STANDOUT) && + (cuser.uflag & DBCS_NOINTRESC) && + DBCS_RemoveIntrEscape(bp->data, &len)) + { + // if anything changed, dirty whole line. + bp->len = len; + } +#endif // DBCSAWARE + if (bp->mode & STANDOUT) { standoutput((char *)bp->data, 0, len, bp->sso, bp->eso); } @@ -188,7 +200,8 @@ refresh(void) { /* TODO remove unnecessary refresh() call, to save CPU time */ register screenline_t *bp = big_picture; - register int i, j, len; + register int i, j; + int len; if (num_in_buf()) return; @@ -221,6 +234,17 @@ refresh(void) { bp->mode &= ~(MODIFIED); +#ifdef DBCSAWARE + if (!(bp->mode & STANDOUT) && + (cuser.uflag & DBCS_NOINTRESC) && + DBCS_RemoveIntrEscape(bp->data, &len)) + { + // if anything changed, dirty whole line. + bp->len = len; + bp->smod = 0; bp->emod = len; + } +#endif // DBCSAWARE + // more effort to determine ANSI smod if (bp->smod > 0) { diff --git a/mbbsd/user.c b/mbbsd/user.c index f2475e95..05289ef6 100644 --- a/mbbsd/user.c +++ b/mbbsd/user.c @@ -335,6 +335,7 @@ void Customize(void) COLORED_MODMARK, #ifdef DBCSAWARE DBCSAWARE_FLAG, + DBCS_NOINTRESC, #endif 0, }; @@ -345,6 +346,7 @@ void Customize(void) "改用色彩代替修改符號 (+)", #ifdef DBCSAWARE "自動偵測雙位元字集(如全型中文)", + "禁止插入雙位元的色碼(一字雙色)", #endif 0, }; -- cgit v1.2.3