summaryrefslogtreecommitdiffstats
path: root/mbbsd/mbbsd.c
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-03-20 13:23:19 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-03-20 13:23:19 +0800
commitd49915829f62db7a1185f6e2c7e00096efa3b651 (patch)
tree1f6402226f9b051a81c92304fdea75b3ad26e105 /mbbsd/mbbsd.c
parent52dc0246ac67225333677100aa78df31b53a0374 (diff)
downloadpttbbs-d49915829f62db7a1185f6e2c7e00096efa3b651.tar
pttbbs-d49915829f62db7a1185f6e2c7e00096efa3b651.tar.gz
pttbbs-d49915829f62db7a1185f6e2c7e00096efa3b651.tar.bz2
pttbbs-d49915829f62db7a1185f6e2c7e00096efa3b651.tar.lz
pttbbs-d49915829f62db7a1185f6e2c7e00096efa3b651.tar.xz
pttbbs-d49915829f62db7a1185f6e2c7e00096efa3b651.tar.zst
pttbbs-d49915829f62db7a1185f6e2c7e00096efa3b651.zip
waterball
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@54 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/mbbsd.c')
-rw-r--r--mbbsd/mbbsd.c37
1 files changed, 19 insertions, 18 deletions
diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c
index 59cc974f..9b223c23 100644
--- a/mbbsd/mbbsd.c
+++ b/mbbsd/mbbsd.c
@@ -1,4 +1,4 @@
-/* $Id: mbbsd.c,v 1.13 2002/03/19 04:47:34 in2 Exp $ */
+/* $Id: mbbsd.c,v 1.14 2002/03/20 05:23:19 in2 Exp $ */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
@@ -369,7 +369,7 @@ static int add_history_water(water_t *w, msgque_t *msg)
static int
add_history(msgque_t *msg)
{
- int i = 0, j;
+ int i = 0, j, waterinit = 0;
water_t *tmp;
if( WATERMODE(WATER_ORIG) || WATERMODE(WATER_NEW) )
add_history_water(&water[0], msg);
@@ -377,24 +377,25 @@ add_history(msgque_t *msg)
for(i = 0 ; i < 5 && swater[i] ; i++ )
if( swater[i]->pid == msg->pid )
break;
- if( i != 5 ){
- if( !swater[i] ){
- water_usies = i + 1;
- swater[i] = &water[i + 1];
- strcpy(swater[i]->userid, msg->userid);
- swater[i]->pid = msg->pid;
- swater[i]->uin = (userinfo_t *)search_ulist_pid(msg->pid);
- }
- tmp = swater[i];
- }
- else{
- tmp = swater[4];
- memset(swater[4], 0, sizeof (water_t));
- strcpy(swater[4]->userid, msg->userid);
- swater[4]->pid = msg->pid;
- swater[4]->uin = (userinfo_t *)search_ulist_pid(msg->pid);
+ if( i == 5 ){
+ waterinit = 1;
i = 4;
+ memset(swater[4], 0, sizeof(water_t));
+ }
+ else if( !swater[i] ){
+ water_usies = i + 1;
+ swater[i] = &water[i + 1];
+ waterinit = 1;
}
+ tmp = swater[i];
+
+ if( waterinit ){
+ memcpy(swater[i]->userid, msg->userid, sizeof(swater[i]->userid));
+ swater[i]->pid = msg->pid;
+ }
+
+ if( !swater[i]->uin )
+ swater[i]->uin = currutmp;
for( j = i ; j > 0 ; j-- )
swater[j] = swater[j - 1];