]> diplodocus.org Git - nmh/blobdiff - sbr/dtime.c
Correct first-line comments where filename is wrong.
[nmh] / sbr / dtime.c
index acab87746a31e2729d5e64a0f9117b737d7c8d43..52f3a79019c3c8eee1135322fdfce9fc6a184b14 100644 (file)
@@ -1,6 +1,4 @@
-
-/*
- * dtime.c -- time/date routines
+/* dtime.c -- time/date routines
  *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
@@ -41,12 +39,6 @@ char *tw_ldotw[] = {
     "Saturday",  NULL
 };
 
-struct zone {
-    char *std;
-    char *dst;
-    int shift;
-};
-
 static int dmsize[] = {
     31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
 };
@@ -108,7 +100,14 @@ dlocaltime (time_t *clock)
     if (tm->tm_isdst)                  /* if DST is in effect */
        tw.tw_zone -= 60;               /* reset to normal offset */
 #else
-    tzset();
+    {
+        static bool deja_vu;
+
+        if (!deja_vu) {
+            deja_vu = true;
+            tzset();
+        }
+    }
     tw.tw_zone = -(timezone / 60);
 #endif
 
@@ -232,9 +231,9 @@ dtime (time_t *clock, int alpha_timezone)
     if (alpha_timezone)
        /* use alpha-numeric timezones */
        return dasctime (dlocaltime (clock), TW_NULL);
-    else
-       /* use numeric timezones */
-       return dasctime (dlocaltime (clock), TW_ZONE);
+
+    /* use numeric timezones */
+    return dasctime (dlocaltime (clock), TW_ZONE);
 }