aboutsummaryrefslogtreecommitdiff
path: root/timezone/zdump.c
diff options
context:
space:
mode:
Diffstat (limited to 'timezone/zdump.c')
-rw-r--r--timezone/zdump.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/timezone/zdump.c b/timezone/zdump.c
index f6480bb308..8c4f6ad1df 100644
--- a/timezone/zdump.c
+++ b/timezone/zdump.c
@@ -127,7 +127,7 @@ extern char * optarg;
extern int optind;
extern char * tzname[2];
-static char * abbr P((struct tm * tmp));
+static const char *abbr P((struct tm * tmp));
static long delta P((struct tm * newp, struct tm * oldp));
static time_t hunt P((char * name, time_t lot, time_t hit));
static size_t longest;
@@ -358,15 +358,19 @@ int v;
(void) printf("\n");
}
-static char *
+static const char *
abbr(tmp)
struct tm * tmp;
{
- register char * result;
- static char nada;
+ register const char *result;
+ static const char nada;
+#ifdef TM_ZONE
+ result = tmp->TM_ZONE;
+#else /* !defined TM_ZONE */
if (tmp->tm_isdst != 0 && tmp->tm_isdst != 1)
return &nada;
result = tzname[tmp->tm_isdst];
+#endif /* !defined TM_ZONE */
return (result == NULL) ? &nada : result;
}