@@ -91,12 +91,13 @@ $1 == "#PACKRATLIST" && $2 == PACKRATLIST {
9191/^ Zone / { zone = $2 }
9292
9393DATAFORM != " main" {
94- in_comment = /^ # /
94+ in_comment = $0 ~ /^ # /
9595 uncomment = comment_out = 0
9696
9797 # If this line should differ due to Czechoslovakia using negative SAVE values,
9898 # uncomment the desired version and comment out the undesired one.
99- if (zone == " Europe/Prague" && /^ #?[\t ]+[01]:00[\t ]/ && /1947 Feb 23/) {
99+ if (zone == " Europe/Prague" && $0 ~ /^ #? [\t ]+ [01 ]:00[\t ] / \
100+ && $0 ~ /1947 Feb 23 /) {
100101 if (($(in_comment + 2 ) != " -" ) == (DATAFORM != " rearguard" )) {
101102 uncomment = in_comment
102103 } else {
@@ -106,9 +107,9 @@ DATAFORM != "main" {
106107
107108 # If this line should differ due to Ireland using negative SAVE values,
108109 # uncomment the desired version and comment out the undesired one.
109- Rule_Eire = /^ #? Rule[\t ]+ Eire[\t ] /
110+ Rule_Eire = $0 ~ /^ #? Rule[\t ]+ Eire[\t ] /
110111 Zone_Dublin_post_1968 \
111- = (zone == " Europe/Dublin" && /^ #? [\t ]+ [01 ]:00[\t ] / \
112+ = (zone == " Europe/Dublin" && $0 ~ /^ #? [\t ]+ [01 ]:00[\t ] / \
112113 && (! $(in_comment + 4 ) || 1968 < $(in_comment + 4 )))
113114 if (Rule_Eire || Zone_Dublin_post_1968) {
114115 if ((Rule_Eire \
@@ -122,9 +123,9 @@ DATAFORM != "main" {
122123
123124 # If this line should differ due to Namibia using negative SAVE values,
124125 # uncomment the desired version and comment out the undesired one.
125- Rule_Namibia = /^ #? Rule[\t ]+ Namibia[\t ] /
126+ Rule_Namibia = $0 ~ /^ #? Rule[\t ]+ Namibia[\t ] /
126127 Zone_using_Namibia_rule \
127- = (zone == " Africa/Windhoek" && /^ #? [\t ]+ [12 ]:00[\t ] / \
128+ = (zone == " Africa/Windhoek" && $0 ~ /^ #? [\t ]+ [12 ]:00[\t ] / \
128129 && ($(in_comment + 2 ) == " Namibia" \
129130 || ($(in_comment + 2 ) == " -" && $(in_comment + 3 ) == " CAT" \
130131 && ((1994 <= $(in_comment + 4 ) && $(in_comment + 4 ) <= 2017 ) \
@@ -142,8 +143,8 @@ DATAFORM != "main" {
142143
143144 # If this line should differ due to Portugal benefiting from %z if supported,
144145 # uncomment the desired version and comment out the undesired one.
145- if (/^ #? [\t ]+ -[12 ]:00[\t ]+ Port[\t ]+ [% + - ] /) {
146- if (/%z / == (DATAFORM == " vanguard" )) {
146+ if ($0 ~ /^ #? [\t ]+ -[12 ]:00[\t ]+ Port[\t ]+ [% + - ] /) {
147+ if (( $0 ~ /%z /) == (DATAFORM == " vanguard" )) {
147148 uncomment = in_comment
148149 } else {
149150 comment_out = ! in_comment
@@ -164,8 +165,8 @@ DATAFORM != "main" {
164165 sub (/-00CHANGE-TO-%z /, " -00" )
165166 sub (/[- + ][^ \t ]+ CHANGE-TO- /, " " )
166167 } else {
167- if (/^ [^ # ]* %z /) {
168- stdoff_column = 2 * /^ Zone/ + 1
168+ if ($0 ~ /^ [^ # ]* %z /) {
169+ stdoff_column = 2 * ( $0 ~ /^ Zone /) + 1
169170 rules_column = stdoff_column + 1
170171 stdoff = get_minutes($stdoff_column)
171172 rules = $rules_column
@@ -184,9 +185,9 @@ DATAFORM != "main" {
184185 dstoff = 20
185186 } else if (((rules == " Cook" || rules == " LH" ) && NF == 3 ) \
186187 || (rules == " Uruguay" \
187- && / [ \t ] (1942 Dec 14 |1960 |1970 |1974 Dec 22 )$/ )) {
188+ && $0 ~ /[\t ](1942 Dec 14| 1960| 1970| 1974 Dec 22)$ /)) {
188189 dstoff = 30
189- } else if (rules == " Uruguay" && / [ \t ] 1974 Mar 10 $/ ) {
190+ } else if (rules == " Uruguay" && $0 ~ /[\t ]1974 Mar 10$ /) {
190191 dstoff = 90
191192 } else {
192193 dstoff = 60
@@ -222,7 +223,7 @@ DATAFORM != "main" {
222223 stdoff_subst[ 1 ] = rounded_stdoff
223224 }
224225 } else if (stdoff_subst[ 0 ] ) {
225- stdoff_column = 2 * /^ Zone/ + 1
226+ stdoff_column = 2 * ( $0 ~ /^ Zone /) + 1
226227 stdoff_column_val = $stdoff_column
227228 if (stdoff_column_val == stdoff_subst[ 0 ] ) {
228229 sub (stdoff_subst[ 0 ] , stdoff_subst[ 1 ] )
@@ -233,7 +234,7 @@ DATAFORM != "main" {
233234
234235 # In rearguard form, change the Japan rule line with "Sat>=8 25:00"
235236 # to "Sun>=9 1:00", to cater to zic before 2007 and to older Java.
236- if (/^ Rule / && $2 == " Japan" ) {
237+ if ($0 ~ /^ Rule / && $2 == " Japan" ) {
237238 if (DATAFORM == " rearguard" ) {
238239 if ($7 == " Sat>=8" && $8 == " 25:00" ) {
239240 sub (/Sat>=8 /, " Sun>=9" )
@@ -250,7 +251,7 @@ DATAFORM != "main" {
250251 # In rearguard form, change the Morocco lines with negative SAVE values
251252 # to use positive SAVE values.
252253 if ($2 == " Morocco" ) {
253- if (/^ Rule /) {
254+ if ($0 ~ /^ Rule /) {
254255 if ($4 ~ /^ 201[78 ]$ / && $6 == " Oct" ) {
255256 if (DATAFORM == " rearguard" ) {
256257 sub (/\t 2018\t /, " \t 2017\t " )
@@ -290,8 +291,10 @@ DATAFORM != "main" {
290291/^ Zone / {
291292 packrat_ignored = FILENAME == PACKRATDATA && PACKRATLIST && ! packratlist[ $2 ] ;
292293}
293- packrat_ignored && ! /^ Rule / {
294- sub (/^ /, " #" )
294+ {
295+ if (packrat_ignored && $0 !~ /^ Rule /) {
296+ sub (/^ /, " #" )
297+ }
295298}
296299
297300# If a Link line is followed by a Link or Zone line for the same data, comment
0 commit comments