diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2017-09-17 20:38:12 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2017-09-17 20:39:12 -0700 |
commit | 541006c53623cb5fb7dfae475baae5d64fc6e9d0 (patch) | |
tree | d3d14ad0815c1c220a90aea03e86db97b9bf23bf /src | |
parent | 679e05eeb97eae5a32fc67f4673b019c873ebcca (diff) | |
download | emacs-541006c53623cb5fb7dfae475baae5d64fc6e9d0.tar.gz |
Fix format-time-string %Z bug with negative tz
* src/editfns.c (tzlookup): Fix sign error in %Z when a purely
numeric zone is negative (Bug#28746).
* test/src/editfns-tests.el (format-time-string-with-zone):
Add test for this bug.
Diffstat (limited to 'src')
-rw-r--r-- | src/editfns.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/editfns.c b/src/editfns.c index b03eb947dec..2f8b075817a 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -187,7 +187,8 @@ tzlookup (Lisp_Object zone, bool settz) if (sec != 0) prec += 2, numzone = 100 * numzone + sec; } - sprintf (tzbuf, tzbuf_format, prec, numzone, + sprintf (tzbuf, tzbuf_format, prec, + XINT (zone) < 0 ? -numzone : numzone, &"-"[XINT (zone) < 0], hour, min, sec); zone_string = tzbuf; } |