[PATCH] Fix warning message with non-alphanumerics
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.
Thanks for reporting that and for suggesting a fix. I installed the attached, which fixes the bug in a slightly different way so that the resulting zdump code is a tiny bit simpler.
participants (2)
-
Paul Eggert -
Paul Ganssle