summaryrefslogtreecommitdiffstats
path: root/mbbsd/io.c
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-06-08 19:15:39 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-06-08 19:15:39 +0800
commit71f79c7083cc15749079d7241ca46f186f304012 (patch)
tree8052a10f3dbd5061172d12ee8698d65f70ae60a2 /mbbsd/io.c
parent524f96649436d3aa687c237a61c82cee5cf2e145 (diff)
downloadpttbbs-71f79c7083cc15749079d7241ca46f186f304012.tar
pttbbs-71f79c7083cc15749079d7241ca46f186f304012.tar.gz
pttbbs-71f79c7083cc15749079d7241ca46f186f304012.tar.bz2
pttbbs-71f79c7083cc15749079d7241ca46f186f304012.tar.lz
pttbbs-71f79c7083cc15749079d7241ca46f186f304012.tar.xz
pttbbs-71f79c7083cc15749079d7241ca46f186f304012.tar.zst
pttbbs-71f79c7083cc15749079d7241ca46f186f304012.zip
New DBCS aware: detecting and reversed default value
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2803 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/io.c')
-rw-r--r--mbbsd/io.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/mbbsd/io.c b/mbbsd/io.c
index 23ee3b47..c30e7aec 100644
--- a/mbbsd/io.c
+++ b/mbbsd/io.c
@@ -568,7 +568,7 @@ strip_nonebig5(unsigned char *str, int maxlen)
#ifdef DBCSAWARE_GETDATA
-#define ISDBCSAWARE() (!(cuser.uflag & RAWDBCS_FLAG))
+#define ISDBCSAWARE() (cuser.uflag & DBCSAWARE_FLAG)
int getDBCSstatus(unsigned char *s, int pos)
{
@@ -755,6 +755,12 @@ oldgetdata(int line, int col, const char *prompt, char *buf, int len, int echo)
break;
default:
if (isprint2(ch) && clen < len && x + clen < scr_cols) {
+#ifdef DBCSAWARE_GETDATA
+ /* to prevent single byte input */
+ if(ISDBCSAWARE() &&
+ clen >= len-1 && ch >= 0x80)
+ break;
+#endif
for (i = clen + 1; i > currchar; i--)
buf[i] = buf[i - 1];
buf[currchar] = ch;