diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2015-07-27 16:50:44 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2015-07-27 16:51:22 -0700 |
commit | 2856b1dd6f0ff5164eb5a54ddfadb9963f9e9237 (patch) | |
tree | cff0c4728088e2cfc6939bd4a752c619a54c1cbd /lib/strftime.c | |
parent | 094d5e9ef0fac319816c00cc52e0a0f2ef41be37 (diff) | |
download | emacs-2856b1dd6f0ff5164eb5a54ddfadb9963f9e9237.tar.gz |
Merge from gnulib
This incorporates:
2015-07-27 time_rz: port better to MinGW
2015-07-27 time: port __need_time_t to MinGW
* lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
* lib/strftime.c, lib/time.in.h, lib/time_rz.c: Copy from gnulib.
* lib/time-internal.h: New file, from gnulib.
Diffstat (limited to 'lib/strftime.c')
-rw-r--r-- | lib/strftime.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/strftime.c b/lib/strftime.c index c7cec2621c9..d1ca346b687 100644 --- a/lib/strftime.c +++ b/lib/strftime.c @@ -30,6 +30,7 @@ # else # include "strftime.h" # endif +# include "time-internal.h" #endif #include <ctype.h> @@ -440,6 +441,9 @@ strftime_case_ (bool upcase, STREAM_OR_CHAR_T *s, # 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; STREAM_OR_CHAR_T *p = s; @@ -475,6 +479,10 @@ strftime_case_ (bool upcase, STREAM_OR_CHAR_T *s, } 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 @@ -483,7 +491,7 @@ strftime_case_ (bool upcase, STREAM_OR_CHAR_T *s, } /* 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 = ""; |