From 8b152e49609a7931a7f8980094303d3988764fe0 Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Thu, 8 Jul 2004 19:33:00 +0000 Subject: [PATCH] Fixed reset LR pointers in empty message areas. --- ChangeLog | 4 ++++ TODO | 6 ------ lib/jammsg.c | 10 ++++++++-- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index a39739fb..976baf18 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,10 @@ v0.61.1 20-Jun-2004. used then mbfido behaves like it did upto version 0.50.0 and mbnntp is disabled. + libmsgbase.a: + If a message area becomes empty after a pack, all lastread + pointers are reset to zero. + mbfido: Added compile directive for full newsgate. diff --git a/TODO b/TODO index 34c4f02e..bcae37f6 100644 --- a/TODO +++ b/TODO @@ -29,12 +29,6 @@ libdiesel.a: U: Processed stringlines containing unbalanced " characters are not processed, instead the previous macro value will be returned. -libmsgbase.a: - N: If a area becomes empty, the lastread pointers have the wrong value - the should be zero so that when a new (first) message arrives in the - area, mbsebbs, GoldED etc will show that there are new unread - messages in the area. - mbsebbs: U: If a users homedir is missing, the users sees a wrong error message before the connection is terminated. diff --git a/lib/jammsg.c b/lib/jammsg.c index 4b982ba0..b602f3de 100644 --- a/lib/jammsg.c +++ b/lib/jammsg.c @@ -709,12 +709,18 @@ void JAM_Pack(void) } /* - * Now copy the lastread file + * Now copy the lastread file, reset LastRead pointers if area is empty. */ lseek(fdJlr, 0, SEEK_SET); for (i = 0; i < count; i++) { - if (read(fdJlr, &LR, sizeof(lastread)) == sizeof(lastread)) + if (read(fdJlr, &LR, sizeof(lastread)) == sizeof(lastread)) { + if (jamHdrInfo.ActiveMsgs == 0 && (LR.LastReadMsg || LR.HighReadMsg)) { + Syslog('-', "jamPack: reset LR pointer index %d, area %s", i, BaseName); + LR.LastReadMsg = 0; + LR.HighReadMsg = 0; + } write(fdnJlr, &LR, sizeof(lastread)); + } } /*