Hello,
In scsh/time.scm format-time-zone is defined by
(define (format-time-zone name offset)
(if (zero? offset) name
(receive (sign offset)
(if (< offset 0)
(values #\+ (- offset)) ; Notice the flipped sign
(values #\- offset)) ; of SIGN.
(let* ((offset (modulo offset 86400))
(h (quotient offset 3600))
(m (quotient (modulo offset 3600) 60))
(s (modulo offset 60)))
(if (zero? s)
(if (zero? m)
(format #f "~a~a~d" name sign h) ; name+h
-> (format #f "~a~a~a:~a" ; name+hh:mm
sign (two-digits h) (two-digits m)))
-> (format #f "~a~a~a:~a:~a" ; name+hh:mm:ss
sign (two-digits h) (two-digits m) (two-digits
s)))))))
Am I dreaming or are there one too many "~a"s on the two lines marked `->'?
On my system (Debian Linux 1.3.1/scsh 0.5.1) this causes a first call
to (date) to fail "insufficient arguments to format", while a second
call works correctly.
--
Eric Marsden
emarsden @ mail.dotcom.fr
It's elephants all the way down
|