summaryrefslogtreecommitdiffstats
path: root/mbbsd/io.c
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-06-07 21:48:08 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-06-07 21:48:08 +0800
commit182387c0a890b4fb63572c0001e00271ec425e78 (patch)
tree8fa3dc61344225d39efe56dfb0f9a19bcf9f6940 /mbbsd/io.c
parent72cc341f9fe53547460915edcf32cc99630898c5 (diff)
downloadpttbbs-182387c0a890b4fb63572c0001e00271ec425e78.tar
pttbbs-182387c0a890b4fb63572c0001e00271ec425e78.tar.gz
pttbbs-182387c0a890b4fb63572c0001e00271ec425e78.tar.bz2
pttbbs-182387c0a890b4fb63572c0001e00271ec425e78.tar.lz
pttbbs-182387c0a890b4fb63572c0001e00271ec425e78.tar.xz
pttbbs-182387c0a890b4fb63572c0001e00271ec425e78.tar.zst
pttbbs-182387c0a890b4fb63572c0001e00271ec425e78.zip
dbcs_aware: can be toggled.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2789 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/io.c')
-rw-r--r--mbbsd/io.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/mbbsd/io.c b/mbbsd/io.c
index 0b9a7f53..26201c7c 100644
--- a/mbbsd/io.c
+++ b/mbbsd/io.c
@@ -531,6 +531,8 @@ strip_nonebig5(unsigned char *str, int maxlen)
#ifdef DBCSAWARE_GETDATA
+#define ISDBCSAWARE() (!(cuser.uflag & RAWDBCS_FLAG))
+
int getDBCSstatus(unsigned char *s, int pos)
{
int sts = DBCS_ASCII;
@@ -635,6 +637,7 @@ oldgetdata(int line, int col, const char *prompt, char *buf, int len, int echo)
--currchar;
#ifdef DBCSAWARE_GETDATA
if(currchar > 0 &&
+ ISDBCSAWARE() &&
getDBCSstatus(buf, currchar) == DBCS_TRAILING)
currchar --;
#endif
@@ -646,6 +649,7 @@ oldgetdata(int line, int col, const char *prompt, char *buf, int len, int echo)
++currchar;
#ifdef DBCSAWARE_GETDATA
if(buf[currchar] &&
+ ISDBCSAWARE() &&
getDBCSstatus(buf, currchar) == DBCS_TRAILING)
currchar++;
#endif
@@ -655,7 +659,10 @@ oldgetdata(int line, int col, const char *prompt, char *buf, int len, int echo)
case Ctrl('H'):
if (currchar) {
#ifdef DBCSAWARE_GETDATA
- int dbcs_off = (getDBCSstatus(buf, currchar-1) == DBCS_TRAILING) ? 2 : 1;
+ int dbcs_off = 1;
+ if (ISDBCSAWARE() &&
+ getDBCSstatus(buf, currchar-1) == DBCS_TRAILING)
+ dbcs_off = 2;
#endif
currchar -= dbcs_off;
clen -= dbcs_off;
@@ -684,8 +691,10 @@ oldgetdata(int line, int col, const char *prompt, char *buf, int len, int echo)
case KEY_DEL:
if (buf[currchar]) {
#ifdef DBCSAWARE_GETDATA
- int dbcs_off = (buf[currchar+1] &&
- getDBCSstatus(buf, currchar+1) == DBCS_TRAILING) ? 2 : 1;
+ int dbcs_off = 1;
+ if (ISDBCSAWARE() && buf[currchar+1] &&
+ getDBCSstatus(buf, currchar+1) == DBCS_TRAILING)
+ dbcs_off = 2;
#endif
clen -= dbcs_off;
for (i = currchar; i <= clen; i++)