From 83adf81141ae0f24b51a0d25eb1134534a3fb08f Mon Sep 17 00:00:00 2001 From: Brian Mastenbrook Date: Thu, 21 Jul 2005 02:44:19 +0000 Subject: [PATCH] 0.9.2.53: "oops". It helps if you actually enable the unbroken code in the situations in which you've unbroken it. ANSI test DECODE-UNIVERSAL-TIME.5 now passes. --- src/code/time.lisp | 33 +++++++++------------------------ version.lisp-expr | 2 +- 2 files changed, 10 insertions(+), 25 deletions(-) diff --git a/src/code/time.lisp b/src/code/time.lisp index dd8d3a5..3a77099 100644 --- a/src/code/time.lisp +++ b/src/code/time.lisp @@ -261,30 +261,15 @@ (hours (+ hour (* days 24)))) (if time-zone (+ second (* (+ minute (* (+ hours time-zone) 60)) 60)) - ;; can't ask unix for times after 2037: this is only a problem - ;; if we need to query the system timezone - (if (> year 2037) - (labels ((leap-year-p (year) - (cond ((zerop (mod year 400)) t) - ((zerop (mod year 100)) nil) - ((zerop (mod year 4)) t) - (t nil)))) - (let* ((fake-year (if (leap-year-p year) 2036 2037)) - (fake-time (encode-universal-time second minute hour - date month fake-year))) - (+ fake-time - (* 86400 (+ (* 365 (- year fake-year)) - (- (leap-years-before year) - (leap-years-before fake-year))))))) - (let* ((secwest-guess - (sb!unix::unix-get-seconds-west - (truncate-to-unix-range (* hours 60 60)))) - (guess (+ second (* 60 (+ minute (* hours 60))) - secwest-guess)) - (secwest - (sb!unix::unix-get-seconds-west - (truncate-to-unix-range guess)))) - (+ guess (- secwest secwest-guess))))))) + (let* ((secwest-guess + (sb!unix::unix-get-seconds-west + (truncate-to-unix-range (* hours 60 60)))) + (guess (+ second (* 60 (+ minute (* hours 60))) + secwest-guess)) + (secwest + (sb!unix::unix-get-seconds-west + (truncate-to-unix-range guess)))) + (+ guess (- secwest secwest-guess)))))) ;;;; TIME diff --git a/version.lisp-expr b/version.lisp-expr index 4c53cf1..68cd439 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.9.2.52" +"0.9.2.53" -- 1.7.10.4