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

Paul Eggert eggert at cs.ucla.edu
Sat Mar 21 21:11:52 UTC 2020


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.
-------------- next part --------------
From f5ca09068c77d98de36ec8abd26d962a1e505bb2 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert at cs.ucla.edu>
Date: Sat, 21 Mar 2020 14:06:58 -0700
Subject: [PATCH] Fix incorrect zdump warning for "AES)T5"
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* zdump.c (abbrok): Fix incorrect warning for cases like
‘zdump "AE)ST5"’.  Problem reported by Paul Ganssle in:
https://mm.icann.org/pipermail/tz/2020-March/028902.html
---
 zdump.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/zdump.c b/zdump.c
index 0fc8ced..b532fe3 100644
--- a/zdump.c
+++ b/zdump.c
@@ -328,12 +328,12 @@ abbrok(const char *const abbrp, const char *const zone)
 	cp = abbrp;
 	while (is_alpha(*cp) || is_digit(*cp) || *cp == '-' || *cp == '+')
 		++cp;
-	if (cp - abbrp < 3)
+	if (*cp)
+	  wp = _("has characters other than ASCII alphanumerics, '-' or '+'");
+	else if (cp - abbrp < 3)
 	  wp = _("has fewer than 3 characters");
 	else if (cp - abbrp > 6)
 	  wp = _("has more than 6 characters");
-	else if (*cp)
-	  wp = _("has characters other than ASCII alphanumerics, '-' or '+'");
 	else
 	  return;
 	fflush(stdout);
-- 
2.17.1



More information about the tz mailing list