[tz] [PROPOSED 06/18] Don’t set TZ in tzselect

Paul Eggert eggert at cs.ucla.edu
Wed Dec 20 18:14:56 UTC 2023


On 2023-12-19 23:30, Philip Paeps wrote:
> On 2023-12-19 15:25:55 (+0800), Paul Eggert via tz wrote:
>> * tzselect.ksh (tz): Rename this shell variable from TZ, so that
>> invoked commands don’t change behavior merely because tzselect is
>> speculating about what TZ setting the user wants.  This is a
>> safety measure for oddball platforms where this might make a
>> difference, as POSIX allows utilities to crash if TZ is bogus.
> 
> Do such oddball platforms exist in the wild?

Yes, we've seen a report of such a problem with old FreeBSD versions, as 
well as in old tzcode versions. See, for example:

https://mm.icann.org/pipermail/tz/1997-January/009772.html

To be honest, though, I had forgotten about these old bug reports. I 
made the change mostly because it's better to be careful with TZ 
settings in a utility that's designed to let you choose TZ and that lets 
you specify the TZ string yourself.


> To a casual reader, seeing $tz instead of $TZ may be confusing.

Yes, I renamed it that way mostly to avoid indenting changes....


> Should we use $tz_for_date instead of $TZ_for_date for consistency?

I didn't make that change, mostly to avoid bloating the output of 'git 
diff' and thus making it easier to review. Could make the change later 
at some point; low priority of course.



More information about the tz mailing list