X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/bfad64befb4d6696fdfb63b119666eec4bac6fb3..8cb6f4ede8a5e0ccd86f22654d72f2f6426305b8:/sbr/dtime.c diff --git a/sbr/dtime.c b/sbr/dtime.c index acab8774..6039b5f1 100644 --- a/sbr/dtime.c +++ b/sbr/dtime.c @@ -41,12 +41,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 +102,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 +233,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); }