diff options
| author | Paul Eggert | 2015-07-27 16:50:44 -0700 |
|---|---|---|
| committer | Paul Eggert | 2015-07-27 16:51:22 -0700 |
| commit | 2856b1dd6f0ff5164eb5a54ddfadb9963f9e9237 (patch) | |
| tree | cff0c4728088e2cfc6939bd4a752c619a54c1cbd /lib/strftime.c | |
| parent | 094d5e9ef0fac319816c00cc52e0a0f2ef41be37 (diff) | |
| download | emacs-2856b1dd6f0ff5164eb5a54ddfadb9963f9e9237.tar.gz emacs-2856b1dd6f0ff5164eb5a54ddfadb9963f9e9237.zip | |
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 @@ | |||
| 30 | # else | 30 | # else |
| 31 | # include "strftime.h" | 31 | # include "strftime.h" |
| 32 | # endif | 32 | # endif |
| 33 | # include "time-internal.h" | ||
| 33 | #endif | 34 | #endif |
| 34 | 35 | ||
| 35 | #include <ctype.h> | 36 | #include <ctype.h> |
| @@ -440,6 +441,9 @@ strftime_case_ (bool upcase, STREAM_OR_CHAR_T *s, | |||
| 440 | # define am_len STRLEN (a_month) | 441 | # define am_len STRLEN (a_month) |
| 441 | # define ap_len STRLEN (ampm) | 442 | # define ap_len STRLEN (ampm) |
| 442 | #endif | 443 | #endif |
| 444 | #if HAVE_TZNAME | ||
| 445 | char **tzname_vec = tzname; | ||
| 446 | #endif | ||
| 443 | const char *zone; | 447 | const char *zone; |
| 444 | size_t i = 0; | 448 | size_t i = 0; |
| 445 | STREAM_OR_CHAR_T *p = s; | 449 | STREAM_OR_CHAR_T *p = s; |
| @@ -475,6 +479,10 @@ strftime_case_ (bool upcase, STREAM_OR_CHAR_T *s, | |||
| 475 | } | 479 | } |
| 476 | else | 480 | else |
| 477 | { | 481 | { |
| 482 | # if !HAVE_TM_ZONE | ||
| 483 | /* Infer the zone name from *TZ instead of from TZNAME. */ | ||
| 484 | tzname_vec = tz->tzname_copy; | ||
| 485 | # endif | ||
| 478 | /* POSIX.1 requires that local time zone information be used as | 486 | /* POSIX.1 requires that local time zone information be used as |
| 479 | though strftime called tzset. */ | 487 | though strftime called tzset. */ |
| 480 | # if HAVE_TZSET | 488 | # if HAVE_TZSET |
| @@ -483,7 +491,7 @@ strftime_case_ (bool upcase, STREAM_OR_CHAR_T *s, | |||
| 483 | } | 491 | } |
| 484 | /* The tzset() call might have changed the value. */ | 492 | /* The tzset() call might have changed the value. */ |
| 485 | if (!(zone && *zone) && tp->tm_isdst >= 0) | 493 | if (!(zone && *zone) && tp->tm_isdst >= 0) |
| 486 | zone = tzname[tp->tm_isdst != 0]; | 494 | zone = tzname_vec[tp->tm_isdst != 0]; |
| 487 | #endif | 495 | #endif |
| 488 | if (! zone) | 496 | if (! zone) |
| 489 | zone = ""; | 497 | zone = ""; |