summaryrefslogtreecommitdiffstats
path: root/mbbsd/io.c
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-04-09 00:12:35 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-04-09 00:12:35 +0800
commit46f0b52197574d76f7f0d852dfd6df208db0980b (patch)
treef7bf5b57c572934465e4ad3bed726819e672f02e /mbbsd/io.c
parente5371ff83e8481cb29f3b9dc1afcfbfa9178c06a (diff)
downloadpttbbs-46f0b52197574d76f7f0d852dfd6df208db0980b.tar
pttbbs-46f0b52197574d76f7f0d852dfd6df208db0980b.tar.gz
pttbbs-46f0b52197574d76f7f0d852dfd6df208db0980b.tar.bz2
pttbbs-46f0b52197574d76f7f0d852dfd6df208db0980b.tar.lz
pttbbs-46f0b52197574d76f7f0d852dfd6df208db0980b.tar.xz
pttbbs-46f0b52197574d76f7f0d852dfd6df208db0980b.tar.zst
pttbbs-46f0b52197574d76f7f0d852dfd6df208db0980b.zip
a patch to fix bug caused by changes of igetch()'s behavior
which was introduced in r2690. (cpu freaks out on chatroom/chess [I_OTHERDATA]) git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2692 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/io.c')
-rw-r--r--mbbsd/io.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/mbbsd/io.c b/mbbsd/io.c
index b2ffd476..9ff8b04d 100644
--- a/mbbsd/io.c
+++ b/mbbsd/io.c
@@ -125,7 +125,7 @@ num_in_buf(void)
* be inconsistent. We try to not segfault here...
*/
- static int
+static int
dogetch(void)
{
ssize_t len;
@@ -221,11 +221,13 @@ dogetch(void)
}
static int water_which_flag = 0;
+
int
igetch(void)
{
register int ch, mode = 0, last = 0;
- while ((ch = dogetch()) >= 0) {
+ while (1) {
+ ch = dogetch();
if (mode == 0 && ch == KEY_ESC) // here is state machine for 2 bytes key
mode = 1;
@@ -435,6 +437,7 @@ igetch(void)
return ch;
}
}
+ // should not reach here. just to make compiler happy.
return 0;
}