From b18f410e30afaf2f8ad321e8625658508a1a2293 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sun, 24 Feb 2008 19:55:10 +0100 Subject: [PATCH] Fix news expiry not to screw up nws_uid delete_old_news() moves unexpired news. Update nws_uid accordingly. It then zaps the slots no longer in use. Don't zap ef_type and nws_uid. --- src/lib/subs/nreport.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/subs/nreport.c b/src/lib/subs/nreport.c index 715a4c84..e1ab70b3 100644 --- a/src/lib/subs/nreport.c +++ b/src/lib/subs/nreport.c @@ -116,15 +116,17 @@ delete_old_news(void) for (j = 0; getnews(i + j, &news); j++) { if (news.nws_when == 0) break; + news.nws_uid = j; putnews(j, &news); } CANT_HAPPEN(i + j != news_tail); news_tail = j; /* mark slots no longer in use */ - memset(&news, 0, sizeof(news)); - for (k = 0; k < i; k++) + for (k = 0; k < i; k++) { + ef_blank(EF_NEWS, j + k, &news); putnews(j + k, &news); + } /* clear cache because moving news invalidated it */ memset(&cache, 0, sizeof(cache));