Author: Run <carlo@alinoe.com>
authorBleep <twhelvey1@home.com>
Sat, 1 Jan 2000 00:00:33 +0000 (00:00 +0000)
committerBleep <twhelvey1@home.com>
Sat, 1 Jan 2000 00:00:33 +0000 (00:00 +0000)
Log message:
Y2K patch (actually, a Yany patch) Extensively tested it.

git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@12 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
ircd/s_misc.c

index 689fa0825e9721473d8ca328441860e42eb21894..469ce0f20d885c049ef6eee36f00b9c2f1bd5db4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,12 +1,13 @@
 #
 # ChangeLog for Undernet ircu Servers
 #
-# $Id: ChangeLog,v 1.5 1999-12-11 08:54:13 bleep Exp $
+# $Id: ChangeLog,v 1.6 2000-01-01 00:00:32 bleep Exp $
 #
 # Please insert new entries on the top of the list, a one or two line comment
 # is sufficient. Please include your name on the entries we know who to blame.
 # Please keep lines < 80 chars.
 #-------------------------------------------------------------------------------
+* s_misc.c (date): add Runs Y2K patch --Bleep
 * hash.c (hChangeClient): bug fix. If the client pointer matched the first
   pointer in the bucket, the change was ignored (returned 0), leaving stale
   values in the hash table, eventually causing the server to die for mysterious
index fa9b078a1984d24cc862d3e57f51813771a792ce..5b00ee11881bcb294f0189a8f3c6d0812e06151c 100644 (file)
@@ -94,12 +94,15 @@ char *date(time_t clock)
   gm = &gmbuf;
   lt = localtime(&clock);
 
-  if (lt->tm_yday == gm->tm_yday)
-    minswest = (gm->tm_hour - lt->tm_hour) * 60 + (gm->tm_min - lt->tm_min);
-  else if (lt->tm_yday > gm->tm_yday)
-    minswest = (gm->tm_hour - (lt->tm_hour + 24)) * 60;
-  else
-    minswest = ((gm->tm_hour + 24) - lt->tm_hour) * 60;
+  minswest = (gm->tm_hour - lt->tm_hour) * 60 + (gm->tm_min - lt->tm_min);
+  if (lt->tm_yday != gm->tm_yday)
+  {
+    if ((lt->tm_yday > gm->tm_yday && lt->tm_year == gm->tm_year) ||
+        (lt->tm_yday < gm->tm_yday && lt->tm_year != gm->tm_year))
+      minswest -= 24 * 60;
+    else
+      minswest += 24 * 60;
+  }
 
   plus = (minswest > 0) ? '-' : '+';
   if (minswest < 0)