diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2017-02-02 07:49:55 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2017-02-02 07:50:22 -0800 |
commit | 46aa9a30095241cabef463fd01f71ce9ee50c4dc (patch) | |
tree | 7c28ccb5f765954c760bdb750fd7b5978ef7114f /lib/strftime.c | |
parent | a362b56b51f49963dbb63cd318967bca9b9fef74 (diff) | |
download | emacs-46aa9a30095241cabef463fd01f71ce9ee50c4dc.tar.gz emacs-46aa9a30095241cabef463fd01f71ce9ee50c4dc.tar.bz2 emacs-46aa9a30095241cabef463fd01f71ce9ee50c4dc.zip |
Merge from gnulib
2017-01-30 Port to PGI 16.10 x86-64
2017-01-20 time_rz: fix comment typo
2017-01-14 strftime: %z is -00 if unknown
This incorporates:
* doc/misc/texinfo.tex, lib/c-ctype.h, lib/strftime.c:
* lib/time-internal.h, lib/verify.h:
Copy from gnulib.
Diffstat (limited to 'lib/strftime.c')
-rw-r--r-- | lib/strftime.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/strftime.c b/lib/strftime.c index 9aabcc6748c..e4d78ef7011 100644 --- a/lib/strftime.c +++ b/lib/strftime.c @@ -739,11 +739,10 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize) /* The mask is not what you might think. When the ordinal i'th bit is set, insert a colon before the i'th digit of the time zone representation. */ -#define DO_TZ_OFFSET(d, negative, mask, v) \ +#define DO_TZ_OFFSET(d, mask, v) \ do \ { \ digits = d; \ - negative_number = negative; \ tz_colon_mask = mask; \ u_number_value = v; \ goto do_tz_offset; \ @@ -1444,6 +1443,7 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize) } #endif + negative_number = diff < 0 || (diff == 0 && *zone == '-'); hour_diff = diff / 60 / 60; min_diff = diff / 60 % 60; sec_diff = diff % 60; @@ -1451,13 +1451,13 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize) switch (colons) { case 0: /* +hhmm */ - DO_TZ_OFFSET (5, diff < 0, 0, hour_diff * 100 + min_diff); + DO_TZ_OFFSET (5, 0, hour_diff * 100 + min_diff); case 1: tz_hh_mm: /* +hh:mm */ - DO_TZ_OFFSET (6, diff < 0, 04, hour_diff * 100 + min_diff); + DO_TZ_OFFSET (6, 04, hour_diff * 100 + min_diff); case 2: tz_hh_mm_ss: /* +hh:mm:ss */ - DO_TZ_OFFSET (9, diff < 0, 024, + DO_TZ_OFFSET (9, 024, hour_diff * 10000 + min_diff * 100 + sec_diff); case 3: /* +hh if possible, else +hh:mm, else +hh:mm:ss */ @@ -1465,7 +1465,7 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize) goto tz_hh_mm_ss; if (min_diff != 0) goto tz_hh_mm; - DO_TZ_OFFSET (3, diff < 0, 0, hour_diff); + DO_TZ_OFFSET (3, 0, hour_diff); default: goto bad_format; |