[tz] 2018c minor issue

Paul Eggert eggert at cs.ucla.edu
Tue Jan 23 23:04:42 UTC 2018


On 01/23/2018 02:39 PM, Pascal Werz wrote:
> I tried to build the 2018c release of tz code and data and found that 
> file zishrink.awk line 40:
> gsub(/[\f\r\t\v ]+/, " ", line)
> erroneously changed all 'v' characters to spaces as '\v' was not 
> recognized as an escape sequence (hence handled as 'v') on my OS. 
> Changing the line to
> gsub(/[\f\r\t\013 ]+/, " ", line)
> or removing '\v' from the regexp allowed the build to be possible again.

Thanks for the bug report. I installed the attached, which should appear 
in the next release. POSIX requires awk to support \v but if mawk can 
stray from POSIX I suppose macOS awk can too.
-------------- next part --------------
From 5293073279e5a67014fac54218e43443e243fa71 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert at cs.ucla.edu>
Date: Tue, 23 Jan 2018 14:54:15 -0800
Subject: [PROPOSED] Port recent mawk change to macOS 10.13.2
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

(Problem with macOS reported by Pascal Werz.)
* zishrink.awk: Do not use \f, \r, or \v in awk bracket
expressions.  They were not in 7th Edition Unix awk, \v does not
work in macOS 10.13.2 awk, and none of these characters should be
present in the input anyway, as per ‘make check_white_space’.
---
 zishrink.awk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/zishrink.awk b/zishrink.awk
index 23d623e..d617644 100644
--- a/zishrink.awk
+++ b/zishrink.awk
@@ -37,7 +37,7 @@ function process_input_line(line, field, end, i, n, startdef)
   # Remove comments, normalize spaces, and append a space to each line.
   sub(/#.*/, "", line)
   line = line " "
-  gsub(/[\f\r\t\v ]+/, " ", line)
+  gsub(/[\t ]+/, " ", line)
 
   # Abbreviate keywords.  Do not abbreviate "Link" to just "L",
   # as pre-2017c zic erroneously diagnoses "Li" as ambiguous.
@@ -148,7 +148,7 @@ BEGIN {
   print "# This zic input file is in the public domain."
 }
 
-/^[\f\r\t\v ]*[^#\f\r\t\v ]/ {
+/^[\t ]*[^#\t ]/ {
   process_input_line($0)
 }
 
-- 
2.14.3



More information about the tz mailing list