[tz] [PATCH] Fix warning message with non-alphanumerics

Paul Ganssle paul at ganssle.io
Fri Mar 20 14:37:17 UTC 2020


Hi folks,

I have noticed a minor issue with the warning issued by zdump when
passed non-alphanumerics in a TZ string. If the TZ string, in quoted or
unquoted form, contains a non-alphanumeric within the first 3
characters, the message erroneously says that the abbreviation has fewer
than 3 characters:

$ zdump '<AE)ST>5'
<AE)ST>5  Fri Mar 20 09:11:05 2020 AE_ST
zdump: warning: zone "<AE)ST>5" abbreviation "AE_ST" has fewer than 3
characters

$ zdump '<AES)T>5'
<AES)T>5  Fri Mar 20 09:11:09 2020 AES_T
zdump: warning: zone "<AES)T>5" abbreviation "AES_T" has characters
other than ASCII alphanumerics, '-' or '+'

$ zdump 'AE)ST5'
AE)ST5  Fri Mar 20 09:09:41 2020 AE_ST
zdump: warning: zone "AE)ST5" abbreviation "AE_ST" has fewer than 3
characters

$ zdump 'AES)T5'
AES)T5  Fri Mar 20 09:09:51 2020 AES_T
zdump: warning: zone "AES)T5" abbreviation "AES_T" has characters other
than ASCII alphanumerics, '-' or '+'

I've attached a patch that I believe fixes this issue, as evidenced by
this check run in my local directory:

$ ./zdump "<AT>5"
<AT>5  Fri Mar 20 09:35:09 2020 AT
./zdump: warning: zone "<AT>5" abbreviation "AT" has fewer than 3 characters
$ ./zdump "<AE)ST>5"
<AE)ST>5  Fri Mar 20 09:35:24 2020 AE_ST
./zdump: warning: zone "<AE)ST>5" abbreviation "AE_ST" has characters
other than ASCII alphanumerics, '-' or '+'

Thanks!
Paul

P.S. git send-email didn't work for me because I haven't set up git to
send e-mails directly, so hopefully attaching the .patch file manually
is OK.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-warning-message-with-non-alphanumerics.patch
Type: text/x-patch
Size: 998 bytes
Desc: not available
URL: <http://mm.icann.org/pipermail/tz/attachments/20200320/176a6f32/0001-Fix-warning-message-with-non-alphanumerics-0001.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://mm.icann.org/pipermail/tz/attachments/20200320/176a6f32/signature-0001.asc>


More information about the tz mailing list