diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2018-09-21 14:24:42 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2018-09-21 14:25:19 -0700 |
commit | 0bec064454adac2bdff04a11bbdfaa79aa4ce052 (patch) | |
tree | ab85b4e46d2ab44dd3d02b85a5a540470842e470 /src/editfns.c | |
parent | 167274d44f1ccaee65a5b68e15c3ed79a53447d1 (diff) | |
download | emacs-0bec064454adac2bdff04a11bbdfaa79aa4ce052.tar.gz |
Fix ambiguity in nil DST flag
Formerly nil meant both that DST was not in effect and that
the DST flag was unknown, and different functions interpreted
the flag differently. Now the meaning is consistently nil for
DST not in effect, and -1 for DST flag not known.
* doc/lispref/os.texi (Time Conversion): The DST slot is
now three-valued, not two-.
* doc/misc/emacs-mime.texi (time-date): Adjust to new behavior.
* etc/NEWS: Mention this.
* lisp/calendar/parse-time.el (parse-time-string):
* src/editfns.c (Fdecode_time):
Return -1 for unknown DST flag.
* test/lisp/calendar/parse-time-tests.el (parse-time-tests):
Adjust tests to match new behavior, and add a new
test for nil vs -1.
Diffstat (limited to 'src/editfns.c')
-rw-r--r-- | src/editfns.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/editfns.c b/src/editfns.c index 8c7491beedc..047a73f0b8c 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -2165,7 +2165,8 @@ between 0 and 23. DAY is an integer between 1 and 31. MONTH is an integer between 1 and 12. YEAR is an integer indicating the four-digit year. DOW is the day of week, an integer between 0 and 6, where 0 is Sunday. DST is t if daylight saving time is in effect, -otherwise nil. UTCOFF is an integer indicating the UTC offset in +nil if it is not in effect, and -1 if this information is +not available. UTCOFF is an integer indicating the UTC offset in seconds, i.e., the number of seconds east of Greenwich. (Note that Common Lisp has different meanings for DOW and UTCOFF.) @@ -2194,7 +2195,8 @@ usage: (decode-time &optional TIME ZONE) */) make_fixnum (local_tm.tm_mon + 1), make_fixnum (local_tm.tm_year + tm_year_base), make_fixnum (local_tm.tm_wday), - local_tm.tm_isdst ? Qt : Qnil, + (local_tm.tm_isdst < 0 ? make_fixnum (-1) + : local_tm.tm_isdst == 0 ? Qnil : Qt), (HAVE_TM_GMTOFF ? make_fixnum (tm_gmtoff (&local_tm)) : gmtime_r (&time_spec, &gmt_tm) |