Hi,

On NetBSD coreutils tests/date/date-tz.sh test fails. Here is the
behavior on GNU/Linux:

     $ tz_long=$(printf '%2000s' | tr ' ' a)
     $ date -d "TZ=\"${tz_long}0\" 2017"
     Sat Nov  1 01:17:00 PM PDT 2025
     $ echo $?
     0

Here is the behavior on NetBSD:

     $ tz_long=$(printf '%2000s' | tr ' ' a)
     $ date -d "TZ=\"${tz_long}0\" 2017"
     date: invalid date 'TZ="aaaa[many more characters]a0" 2017'
     $ echo $?
     1

The reason for this is tzalloc (used in parse_datetime_body) fails after
256 characters with errno == ENAMETOOLONG but Gnulib's handles
arbitrarily long time zone names.

I wrote a patch to replace timezone_t, tzalloc, etc. on NetBSD to fix
the test. But I started to feel like this was a bad decision, since it
prevents us from using something like strftime_z on NetBSD. It doesn't
seem worth the effort when time zone names will hopefully never be that
long.

Paul, what do you think? Is it worth replacing or should I just commit a
few lines in coreutils to work around the behavior?

Collin

Reply via email to