This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

scsh-0.6.7-2: (date) fails to use local time zone after the first call


According the the scsh manual, (date) is supposed to return the
current date in the local time zone.   However, in the Cygwin
scsh-0.6.7-2 package, it only works that way the first time that
(date) is called.  After that, it returns dates in the UTC timezone.

Test script:

#!/usr/bin/scsh -s
!#
(define (show-date d)
  (display (date:tz-name d))
  (display " ")
  (display (date:tz-secs d))
  (newline))

(show-date (date))
(show-date (date))

Using the Cygwin scsh-0.6.7-2 package, I get this incorrect output --
the two lines should be the same:

PST+8 -28800
UCT 0

I uninstalled the Cygwin scsh package, and rebuilt scsh from source,
using the scsh-0.6.7.tar.gz tarball.  I got the same incorrect
results.

I remade scsh in a Fedora environment from the same tarball, and I got
correct results:

PST+8 -28800
PST+8 -28800

So far, I haven't figured out why I get different results on Cygwin.
I did observe that, on Cygwin, different #ifdef compilation conditions
are used in compiling time1.c.   When compiling on Cygwin, HAVE_TZNAME
is true and HAVE_STRUCT_TM_TM_ZONE is false.  When compiling on
Fedora, the opposite is the case.  I don't know if that is relevant to
my problem, but I thought I'd mention it for what it's worth.

Any suggestions will be much appreciated!

Cheers,

John

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]