[tz] [PROPOSED PATCH 3/4] Port zdump to localtime that sets tm_isdst greater than 1.
Paul Eggert
eggert at cs.ucla.edu
Mon Sep 22 05:53:36 UTC 2014
* zdump.c (abbr): Don't assume localtime sets tm_isdst to 1
for daylight saving time; any positive value will do.
---
zdump.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/zdump.c b/zdump.c
index 92dd3c1..37a0926 100644
--- a/zdump.c
+++ b/zdump.c
@@ -926,9 +926,8 @@ abbr(struct tm const *tmp)
#ifdef TM_ZONE
return tmp->TM_ZONE;
#else
- return ((0 <= tmp->tm_isdst && tmp->tm_isdst <= 1
- && tzname[tmp->tm_isdst])
- ? tzname[tmp->tm_isdst]
+ return (0 <= tmp->tm_isdst && tzname[0 < tmp->tm_isdst]
+ ? tzname[0 < tmp->tm_isdst]
: "");
#endif
}
--
1.9.3
More information about the tz
mailing list