From d68fce366be867a4dbc7bac41b8e75b9c3f6a4e4 Mon Sep 17 00:00:00 2001 From: Neil Fuller Date: Wed, 7 Oct 2020 13:30:08 +0100 Subject: [PATCH] Fix ziguard.awk for #Rule lines For Rule lines, and unlike Zone lines, the addition of # does not increase the number of fields, so there's no need to adjust the field index. This commit also removes some Rule transformations for Eire, as they don't appear to be used. Also minor comment updates. --- ziguard.awk | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/ziguard.awk b/ziguard.awk index e8ef49e..026dbe6 100644 --- a/ziguard.awk +++ b/ziguard.awk @@ -28,7 +28,7 @@ DATAFORM != "main" { in_comment = /^#/ uncomment = comment_out = 0 - # If the line should differ due to Czechoslovakia using negative SAVE values, + # If this line should differ due to Czechoslovakia using negative SAVE values, # uncomment the desired version and comment out the undesired one. if (zone == "Europe/Prague" && /1947 Feb 23/) { if (($(in_comment + 2) != "-") == vanguard) { @@ -40,13 +40,11 @@ DATAFORM != "main" { # If this line should differ due to Ireland using negative SAVE values, # uncomment the desired version and comment out the undesired one. - Rule_Eire = /^#?Rule[\t ]+Eire[\t ]/ Zone_Dublin_post_1968 \ = (zone == "Europe/Dublin" && /^#?[\t ]+[01]:00[\t ]/ \ && (!$(in_comment + 4) || 1968 < $(in_comment + 4))) - if (Rule_Eire || Zone_Dublin_post_1968) { - if ((Rule_Eire \ - || (Zone_Dublin_post_1968 && $(in_comment + 3) == "IST/GMT")) \ + if (Zone_Dublin_post_1968) { + if ((Zone_Dublin_post_1968 && $(in_comment + 3) == "IST/GMT") \ == vanguard) { uncomment = in_comment } else { @@ -64,8 +62,7 @@ DATAFORM != "main" { || in_comment + 3 == NF)) if (Rule_Namibia || Zone_using_Namibia_rule) { if ((Rule_Namibia \ - ? ($(in_comment + 9) ~ /^-/ \ - || ($(in_comment + 9) == 0 && $(in_comment + 10) == "CAT")) \ + ? ($(9) ~ /^-/ || ($(9) == 0 && $(10) == "CAT")) \ : $(in_comment + 1) == "2:00" && $(in_comment + 2) == "Namibia") \ == vanguard) { uncomment = in_comment -- 2.28.0.806.g8561365e88-goog