GNU bug report logs -
#55635
`make-decoded-time' incorrectly sets DST to nil, it should be -1 (guess)
Previous Next
Full log
Message #14 received at 55635 <at> debbugs.gnu.org (full text, mbox):
Paul Eggert <eggert <at> cs.ucla.edu> writes:
>> perhaps -1 is less "filled out" than nil in this
>> case.
>
> Indeed it is, and make-decoded-time's DST flag should default to -1.
So I've now made this change in Emacs 29.
>> It's this code, I guess:
>> ;; When we don't have a time zone, default to DEFAULT-ZONE
>> without
>> ;; DST if DEFAULT-ZONE if given, and to unknown DST otherwise.
>> (unless (decoded-time-zone time)
>> (if default-zone
>> (progn (setf (decoded-time-zone time) default-zone)
>> (setf (decoded-time-dst time) nil))
>> (setf (decoded-time-dst time) -1)))
>
> This looks wrong. Shouldn't it leave the DST flag alone? I.e., just this:
>
> (unless (decoded-time-zone time)
> (setf (decoded-time-zone-time) default-zone))
>
> That is, if we assume that for the DST component -1 means "unknown"
> and nil means "standard time", it should be OK for
> decoded-time-set-defaults to leave the DST component alone, for the
> same reason that it leaves the DOW component alone.
Yes, I think so. But you changed this in a391ffa2f03, and you usually
have a good reason for changes like this, so I thought there must be
something subtle going on here I didn't quite get. 😀
The old code doesn't look quite right, either, I think...
- ;; When we don't have a time zone and we don't have a DST, then mark
- ;; it as unknown.
- (when (and (not (decoded-time-zone time))
- (not (decoded-time-dst time)))
- (setf (decoded-time-dst time) -1))
-
- (when (and (not (decoded-time-zone time))
- default-zone)
- (setf (decoded-time-zone time) 0))
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
This bug report was last modified 2 years and 338 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.