diff --git a/src/server/membership.c b/src/server/membership.c index 2a73ba0714bc28aee88a94ed59461bba35f12ff9..7d19c91f3bf1c2ec5ce09c0def499d95f1499371 100644 --- a/src/server/membership.c +++ b/src/server/membership.c @@ -1,5 +1,5 @@ /* - * $Id: membership.c,v 0.35 1998/08/22 20:46:55 ceder Exp $ + * $Id: membership.c,v 0.36 1998/10/14 20:45:53 ceder Exp $ * Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996 Lysator Academic Computer Association. * * This file is part of the LysKOM server. @@ -32,7 +32,7 @@ #define DEBUG_MARK_AS_READ static const char * -rcsid = "$Id: membership.c,v 0.35 1998/08/22 20:46:55 ceder Exp $"; +rcsid = "$Id: membership.c,v 0.36 1998/10/14 20:45:53 ceder Exp $"; #include "rcs.h" USE(rcsid); @@ -350,11 +350,11 @@ adjust_read( Membership * m, Local_text_no prev; #endif - /* (conf_min <= x <= conf_max) if x is an existing local_text_no */ + /* (conf_min <= x < conf_max) if x is an existing local_text_no */ conf_min = l2g_next_key(&conf->texts, 0); if (conf_min == 0) conf_min = l2g_first_appendable_key(&conf->texts); - conf_max = l2g_first_appendable_key(&conf->texts) - 1; + conf_max = l2g_first_appendable_key(&conf->texts); /* Flag all removed texts as read, if that is not already done. */ if (m->last_text_read < conf_min - 1) @@ -370,8 +370,8 @@ adjust_read( Membership * m, /* This loops advances m->last_text_read as far as possible, advancing handled along when appropriate. m->last_text_read can be increased for one of two reasons: - - The text is present in read_texts. - - The text is deleted. + - The next text is present in read_texts. + - The next text is deleted. This loop handles both cases. */ for ( ; ; ) { @@ -382,8 +382,8 @@ adjust_read( Membership * m, m->last_text_read++; handled++; } - else if (m->last_text_read < conf_max - && l2g_lookup(&conf->texts, m->last_text_read) == 0) + else if (m->last_text_read + 1 < conf_max + && l2g_lookup(&conf->texts, m->last_text_read + 1) == 0) { /* This text is deleted. */ m->last_text_read++;