delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/01/11/16:39:52

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00
X-Spam-Check-By: sourceware.org
Message-ID: <496A66F7.8040908@x-ray.at>
Date: Sun, 11 Jan 2009 22:39:03 +0100
From: Reini Urban <rurban AT x-ray DOT at>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de-AT; rv:1.8.1.19) Gecko/20081204 SeaMonkey/1.1.14
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: scsh-0.6.7-2: (date) fails to use local time zone after the first call
References: <bc4dea070901102027y7550325dlc513ccbcff47cbe7 AT mail DOT gmail DOT com>
In-Reply-To: <bc4dea070901102027y7550325dlc513ccbcff47cbe7@mail.gmail.com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Note-from-DJ: This may be spam

John Russell schrieb:
> 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!

Thanks.
It looks like a untested logic for our HAVE_TZNAME case.

Please report upstream.
-- 
Reini Urban
http://phpwiki.org/  http://murbreak.at/

--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019