From: Dan Harkless Date: Tue, 14 Mar 2000 05:24:57 +0000 (+0000) Subject: Applied Simon Burge 's dtime.c patch: X-Git-Tag: nmh-1_0~63 X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=79fcc0e0c68cd0cb8b9edc7c9db5eeaa2358d756;p=mmh Applied Simon Burge 's dtime.c patch: There's a wrap-around problem that affects the implementation of Zeller's congruence in dtime.c. This causes the day-of-week calculations to fail for dates after Feb 29, 2000 (probably up until some year far in the future). --- diff --git a/ChangeLog b/ChangeLog index ba38c6b..0410e49 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -Mon Mar 13 21:10:16 2000 Dan Harkless +Mon Mar 13 21:32:00 2000 Dan Harkless * Applied Sullivan N. Beck 's mhshow-suffix patch: @@ -23,6 +23,13 @@ Mon Mar 13 21:10:16 2000 Dan Harkless mailbox called, for instance, "dan-nmh" (where username was "dan" and $USERNAME_EXTENSION was "-nmh"). + * Applied Simon Burge 's dtime.c patch: + + There's a wrap-around problem that affects the implementation + of Zeller's congruence in dtime.c. This causes the day-of-week + calculations to fail for dates after Feb 29, 2000 (probably up + until some year far in the future). + Mon Mar 06 12:20:20 2000 Dan Harkless * Applied Neil W Rickert 's msh.c patch: diff --git a/zotnet/tws/dtime.c b/zotnet/tws/dtime.c index bbfccf0..adf153b 100644 --- a/zotnet/tws/dtime.c +++ b/zotnet/tws/dtime.c @@ -460,6 +460,8 @@ set_dotw (struct tws *tw) tw->tw_wday = ((26 * month - 2) / 10 + day + year + year / 4 - 3 * century / 4 + 1) % 7; + if (tw->tw_wday < 0) + tw->tw_wday += 7; tw->tw_flags &= ~TW_SDAY, tw->tw_flags |= TW_SIMP; }