From owner-freebsd-ports Sun Jul 21 13:26:03 1996 Return-Path: owner-ports Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id NAA24769 for ports-outgoing; Sun, 21 Jul 1996 13:26:03 -0700 (PDT) Received: from lear35.cytex.com (root@lear35.cytex.com [38.252.97.5]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id NAA24755 for ; Sun, 21 Jul 1996 13:25:59 -0700 (PDT) Received: (from mbartley@localhost) by lear35.cytex.com (8.7.5/8.7.3) id NAA20762 for freebsd-ports@freebsd.org; Sun, 21 Jul 1996 13:25:50 -0700 (PDT) From: Matt Bartley Message-Id: <199607212025.NAA20762@lear35.cytex.com> Subject: trn-3.6 leap year bug fix To: freebsd-ports@freebsd.org Date: Sun, 21 Jul 1996 13:25:48 -0700 (PDT) X-Mailer: ELM [version 2.4ME+ PL22 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-ports@freebsd.org X-Loop: FreeBSD.org Precedence: bulk This should go in as file /usr/ports/news/trn/patches/patches-aa: ------------------------------ 8< ------------------------------ --- nntp.c.orig Fri Nov 18 22:01:23 1994 +++ nntp.c Sun Jul 21 13:13:58 1996 @@ -319,8 +319,8 @@ for (month--; month; month--) day += maxdays[month]; - ss = ((((year-1970) * 365 + (year-1968)/4 + day - 1) * 24L + hh) * 60 - + mm) * 60 + ss; + ss = ((((year-1970) * 365 + (year-1969)/4 + day - 1) * 24L + hh) * 60 + + mm) * 60 + ss; return ss; } ------------------------------ 8< ------------------------------ The symptom of this leap year bug is that every time trn starts up, it thinks there are new newsgroups, even when there are not. This is a quick fix that was posted to Usenet a while ago. This will work properly until the year 2100 (only). There is a longer, more correct patch, but if anyone is still using trn-3.6 104 years from now it would be pretty pathetic anyway.