From feef527b85c1b9d280f284937ed2a4d632c501b8 Mon Sep 17 00:00:00 2001 From: in2 Date: Fri, 2 Jan 2004 09:19:07 +0000 Subject: NOKILLWATERBALL: fix bug? git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1447 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/mbbsd.c | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) (limited to 'mbbsd') diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c index 8371d7aa..147536e0 100644 --- a/mbbsd/mbbsd.c +++ b/mbbsd/mbbsd.c @@ -362,27 +362,15 @@ write_request(int sig) reentrant_write_request = 1; #endif if (WATERMODE(WATER_OFO)) { - /* - * sig = SIGUSR2 waterball come in 0 flush to water[] (by - * my_write2()) - */ - if (sig != 0) { - if (wmofo == 0) /* 正在回水球 */ - wmofo = 1; - bell(); - show_call_in(1, currutmp->msgcount - 1); - refresh(); - } - if (sig == 0 || /* 回水球的時候又有水球進來, 回完後一次寫回去 */ - wmofo == -1) { /* 不在回水球模式 */ - do { - add_history(&currutmp->msgs[0]); - if (currutmp->msgcount--) - for (i = 0; i < currutmp->msgcount; i++) - currutmp->msgs[i] = currutmp->msgs[i + 1]; + int i, msgcount; + if( (msgcount = currutmp->msgcount) > 0 ){ + for( i = 0 ; i < msgcount ; ++i ){ + bell(); + show_call_in(1, i); + refresh(); + add_history(&currutmp->msgs[i]); } - while (currutmp->msgcount); - currutmp->msgcount = 0; + currutmp->msgcount -= msgcount; } } else { if (currutmp->mode != 0 && -- cgit v1.2.3