diff options
author | Stefan Kuhn <Wuodan0@gmail.com> | 2014-11-22 15:03:10 +0100 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2014-11-22 16:57:41 -0800 |
commit | 66cda43f6783a2b869251f7093689751ae298070 (patch) | |
tree | 25f769fc4f420146273a9faebc44affe81bfc696 | |
parent | eb7519100eb0a0226f71a66ccd0646d7f34c441c (diff) | |
download | tz-66cda43f6783a2b869251f7093689751ae298070.tar.gz |
tzselect: Fix for gawk treating '\.' as plain '.'
When using gawk and Posix TZ in tzselect, this warning is shown:
awk: cmd. line:1: warning: escape sequence `\.' treated as plain `.'
gawk treats '\.' as '.'
mawk treats '\.' as '\.'
both treat '\\.' as '\\.'
The 2nd and 3rd are corrrect for 'Mm.w.d'.
Test:
gawk 'BEGIN{ date = "\."; print date }'
gawk 'BEGIN{ date = "\\."; print date }'
versus:
mawk 'BEGIN{ date = "\."; print date }'
mawk 'BEGIN{ date = "\\."; print date }'
* tzselect.ksh (date): Fix bug that broke POSIX TZ checking with gawk.
* NEWS: Document this.
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | tzselect.ksh | 2 |
2 files changed, 4 insertions, 1 deletions
@@ -8,6 +8,9 @@ Unreleased, experimental changes that tzset always has, by replacing invalid bytes with '_' and by shortening too-long abbreviations. + tzselect no longer mishandles POSIX TZ settings when GNU awk is used. + (Thanks to Stefan Kuhn.) + Changes affecting build procedure 'make check' now checks for links to links in the data. diff --git a/tzselect.ksh b/tzselect.ksh index 029abcd..d5dae17 100644 --- a/tzselect.ksh +++ b/tzselect.ksh @@ -328,7 +328,7 @@ while tzname = "[^-+,0-9][^-+,0-9][^-+,0-9]+" time = "[0-2]?[0-9](:[0-5][0-9](:[0-5][0-9])?)?" offset = "[-+]?" time - date = "(J?[0-9]+|M[0-9]+\.[0-9]+\.[0-9]+)" + date = "(J?[0-9]+|M[0-9]+\\.[0-9]+\\.[0-9]+)" datetime = "," date "(/" time ")?" tzpattern = "^(:.*|" tzname offset "(" tzname \ "(" offset ")?(" datetime datetime ")?)?)$" |