summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2012-02-26 16:24:44 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2012-02-26 16:24:44 +0800
commit22edf406549937475744cae21aa495fc4d9f16c0 (patch)
treeafec8906e22380b9a81b79800e924784b92e19c5
parent5acbc49014b326f5d42052c0717ac25539d165e7 (diff)
downloadpttbbs-22edf406549937475744cae21aa495fc4d9f16c0.tar
pttbbs-22edf406549937475744cae21aa495fc4d9f16c0.tar.gz
pttbbs-22edf406549937475744cae21aa495fc4d9f16c0.tar.bz2
pttbbs-22edf406549937475744cae21aa495fc4d9f16c0.tar.lz
pttbbs-22edf406549937475744cae21aa495fc4d9f16c0.tar.xz
pttbbs-22edf406549937475744cae21aa495fc4d9f16c0.tar.zst
pttbbs-22edf406549937475744cae21aa495fc4d9f16c0.zip
prevent DBCS chars (for ascii art) in hidden text
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5574 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--pttbbs/mbbsd/pfterm.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/pttbbs/mbbsd/pfterm.c b/pttbbs/mbbsd/pfterm.c
index f4d95c05..6ee864af 100644
--- a/pttbbs/mbbsd/pfterm.c
+++ b/pttbbs/mbbsd/pfterm.c
@@ -1021,6 +1021,16 @@ doupdate(void)
fterm_rawattr(FTAMAP[y][x]);
#endif // !DBG_SHOW_DIRTY
+#ifdef PFTERM_DISABLE_HIDDEN_MESSAGE
+ // Disable hidden message, only if current and previous chars are
+ // not DBCS chars. Current dirty format: [CHAR][DBCS]
+ if (FTATTR_GETFG(FTAMAP[y][x]) == FTATTR_GETBG(FTAMAP[y][x]) &&
+ (FTAMAP[y][x] & ~(FTATTR_FGMASK | FTATTR_BGMASK)) == 0 &&
+ !(FTD[x] & FTDIRTY_DBCS) &&
+ !(x + 1 < len && (FTD[x+1] & FTDIRTY_DBCS)))
+ fterm_rawc(' ');
+ else
+#endif
fterm_rawc(FTDC[x]);
ft.rx++;
touched = 1;
@@ -1310,11 +1320,7 @@ outc(unsigned char c)
else // normal characters
{
assert (ft.x >= 0 && ft.x < ft.cols);
-#ifdef PFTERM_DISABLE_HIDDEN_MESSAGE
- if (FTATTR_GETFG(ft.attr) == FTATTR_GETBG(ft.attr) &&
- (ft.attr & ~(FTATTR_FGMASK | FTATTR_BGMASK)) == 0)
- c = ' ';
-#endif
+
#ifdef FTATTR_TRANSPARENT
if (ft.attr != FTATTR_TRANSPARENT)
#endif // FTATTR_TRANSPARENT