diff options
Diffstat (limited to 'mbbsd/visio.c')
-rw-r--r-- | mbbsd/visio.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/mbbsd/visio.c b/mbbsd/visio.c index b0949d01..5a72b698 100644 --- a/mbbsd/visio.c +++ b/mbbsd/visio.c @@ -1013,18 +1013,15 @@ vgetstring(char *_buf, int len, int flags, const char *defstr, const VGET_CALLBA { bell(); continue; } + // prevent incomplete DBCS - // this check only works if DBCS-aware is active. - // Otherwise, non-DBCS-aware users will fail to - // input the final DBCS-TRAIL character. -#ifdef DBCSAWARE - if (ISDBCSAWARE() && - c > 0x80 && iend+2 >= len && - !CHKDBCSTRAIL(buf, icurr) ) + if (c > 0x80 && num_in_buf() && + len - iend < 3) // we need 3 for DBCS+NUL. { - bell(); continue; + drop_input(); + bell(); + continue; } -#endif // DBCSAWARE // callback 2: data if (_vgetcbhandler(cb.data, &abort, |