-/* Copyright (C) 1991-2001, 2003-2007, 2009-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2001, 2003-2007, 2009-2016 Free Software Foundation, Inc.
NOTE: The canonical source of this file is maintained with the GNU C Library.
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
# else
# include "strftime.h"
# endif
+# include "time-internal.h"
#endif
#include <ctype.h>
# define aw_len STRLEN (a_wkday)
# define am_len STRLEN (a_month)
# define ap_len STRLEN (ampm)
+#endif
+#if HAVE_TZNAME
+ char **tzname_vec = tzname;
#endif
const char *zone;
size_t i = 0;
}
else
{
+# if !HAVE_TM_ZONE
+ /* Infer the zone name from *TZ instead of from TZNAME. */
+ tzname_vec = tz->tzname_copy;
+# endif
/* POSIX.1 requires that local time zone information be used as
though strftime called tzset. */
# if HAVE_TZSET
}
/* The tzset() call might have changed the value. */
if (!(zone && *zone) && tp->tm_isdst >= 0)
- zone = tzname[tp->tm_isdst != 0];
+ zone = tzname_vec[tp->tm_isdst != 0];
#endif
if (! zone)
zone = "";
break;
}
- /* As a GNU extension we allow to specify the field width. */
+ /* As a GNU extension we allow the field width to be specified. */
if (ISDIGIT (*f))
{
width = 0;