diff options
| author | Paul Eggert | 2019-04-30 10:45:48 -0700 |
|---|---|---|
| committer | Paul Eggert | 2019-04-30 10:47:17 -0700 |
| commit | 325f51c84d9ad4d9776784bd324b347ffe4fe51b (patch) | |
| tree | 105c43ee218925018d5e778a0b8d52fc02307e69 /src | |
| parent | 35ef33dd234707d611e2a307a3500b4dbcf46cf6 (diff) | |
| download | emacs-325f51c84d9ad4d9776784bd324b347ffe4fe51b.tar.gz emacs-325f51c84d9ad4d9776784bd324b347ffe4fe51b.zip | |
Fix decode-time/encode-time roundtrip on macOS
* src/timefns.c (Fencode_time): Ignore DST flag when the zone is
numeric or is a cons, as the doc string says it’s ignored in that
case, and not ignoring it causes encode-time to not invert
decode-time on some platforms (Bug#35502).
* test/src/timefns-tests.el (encode-time-dst-numeric-zone):
New test.
Diffstat (limited to 'src')
| -rw-r--r-- | src/timefns.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/timefns.c b/src/timefns.c index 5005c73b7fc..7b5af6a5d24 100644 --- a/src/timefns.c +++ b/src/timefns.c | |||
| @@ -1488,10 +1488,11 @@ usage: (encode-time &optional TIME FORM &rest OBSOLESCENT-ARGUMENTS) */) | |||
| 1488 | tm.tm_mon = check_tm_member (XCAR (a), 1); a = XCDR (a); | 1488 | tm.tm_mon = check_tm_member (XCAR (a), 1); a = XCDR (a); |
| 1489 | tm.tm_year = check_tm_member (XCAR (a), TM_YEAR_BASE); a = XCDR (a); | 1489 | tm.tm_year = check_tm_member (XCAR (a), TM_YEAR_BASE); a = XCDR (a); |
| 1490 | a = XCDR (a); | 1490 | a = XCDR (a); |
| 1491 | if (SYMBOLP (XCAR (a))) | 1491 | Lisp_Object dstflag = XCAR (a); |
| 1492 | tm.tm_isdst = !NILP (XCAR (a)); | ||
| 1493 | a = XCDR (a); | 1492 | a = XCDR (a); |
| 1494 | zone = XCAR (a); | 1493 | zone = XCAR (a); |
| 1494 | if (SYMBOLP (dstflag) && !FIXNUMP (zone) && !CONSP (zone)) | ||
| 1495 | tm.tm_isdst = !NILP (dstflag); | ||
| 1495 | } | 1496 | } |
| 1496 | else if (nargs < 6) | 1497 | else if (nargs < 6) |
| 1497 | xsignal2 (Qwrong_number_of_arguments, Qencode_time, make_fixnum (nargs)); | 1498 | xsignal2 (Qwrong_number_of_arguments, Qencode_time, make_fixnum (nargs)); |