Mail Archives: djgpp/2002/10/13/02:14:11
> > A casual inspection of ctime.c (I'm not an expert) looks like to me that
> > at least the first comparison of lcl_is_set should be !=0 instead of >0
> > to cache the case where TZ is not set.
>
> lcl_is_set is set to -1 by tzsetwall. I think it's important to not use
> cached values if they were set by tzsetwall, since it looks at files, and
> files could have changed behind our back. It's the same logic as with
> not calling getenv, except that with files we have no easy way of knowing
> when the relevant files stay put.
>
> I think the _real_ fix is to set TZ. There are no good reasons why not.
There is one excellent reason not to set TZ - you ship an image which
is run outside the DJGPP environment (standalone). These shouldn't run
significantly slower just because an environment variable is not set.
In this case we should just treat it like GMT, cache it, and assume it
doesn't change. If TZ wasn't set before, and the environment wasn't
changed, calling getenv() over and over again doesn't make any sense.
- Raw text -