emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 32a8b3b: Fix regression introduced by the previous date-to-time c


From: Lars Ingebrigtsen
Subject: master 32a8b3b: Fix regression introduced by the previous date-to-time change
Date: Fri, 3 Dec 2021 11:29:24 -0500 (EST)

branch: master
commit 32a8b3bc22bfc0aeca9943699e7a43b68915122b
Author: Katsumi Yamaoka <yamaoka@jpl.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Fix regression introduced by the previous date-to-time change
    
    * lisp/calendar/time-date.el (date-to-time): The function needs to
    test if `parse-time-string' returns a valid data as the old
    version did it with the help of `encode-time' (bug#52209).
---
 lisp/calendar/time-date.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/calendar/time-date.el b/lisp/calendar/time-date.el
index 6407138..8a6ee0f 100644
--- a/lisp/calendar/time-date.el
+++ b/lisp/calendar/time-date.el
@@ -158,7 +158,10 @@ If DATE lacks timezone information, GMT is assumed."
   (encode-time
     (decoded-time-set-defaults
       (condition-case err
-          (parse-time-string date)
+          (let ((time (parse-time-string date)))
+            (prog1 time
+              ;; Cause an error if data `parse-time-string' returns is invalid.
+              (setq time (encode-time time))))
         (error
          (let ((overflow-error '(error "Specified time is not representable")))
            (if (or (equal err overflow-error)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]