From 9c4e5e52c6b9de0ff0873fd76a3d187a19fb45da Mon Sep 17 00:00:00 2001 From: piaip Date: Sat, 6 Jun 2009 14:16:22 +0000 Subject: card: make prompt message more clear, and accept user response better git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4497 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/card.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'mbbsd') diff --git a/mbbsd/card.c b/mbbsd/card.c index 8d5ba389..c3b33d08 100644 --- a/mbbsd/card.c +++ b/mbbsd/card.c @@ -488,10 +488,15 @@ card_ask(void) char buf[100], buf2[3]; move(21, 0); clrtoeol(); - outs("<若想離開請輸入 q>"); + outs("< 若想離開請輸入 q >"); snprintf(buf, sizeof(buf), "[ %s ]您現在共有 %d 枚籌碼,還要加牌嗎? [y/N/q]: ", cuser.userid, card_get_money()); getdata(20, 0, buf, buf2, sizeof(buf2), LCECHO); + + // peek one more byte + if (buf2[0] == ' ') + buf2[0] = buf2[1]; + if (buf2[0] == 'y' || buf2[0] == 'Y') return 1; if (buf2[0] == 'q' || buf2[0] == 'Q') -- cgit v1.2.3