376cc7
commit 401c42d991d4277cd606933fc9f5d9a13d1ac228
376cc7
Author: Paul Eggert <eggert@cs.ucla.edu>
376cc7
Date:   Thu Oct 18 11:06:07 2018 -0700
376cc7
376cc7
    Avoid 25:00 in rearguard format
376cc7
    
376cc7
    (Problem reported by Christos Zoulas.)
376cc7
    * NEWS: Mention this.
376cc7
    * ziguard.awk: Change "Rule ... Sat>=8 25:00" to "Rule ... Sun>=9 1:00".
376cc7
376cc7
diff --git a/NEWS b/NEWS
376cc7
index aeeef10..16f0947 100644
376cc7
--- a/NEWS
376cc7
+++ b/NEWS
376cc7
@@ -1,5 +1,16 @@
376cc7
 News for the tz database
376cc7
 
376cc7
+Unreleased, experimental changes
376cc7
+
376cc7
+  Changes to code
376cc7
+
376cc7
+    The translator to rearguard format now rewrites the line
376cc7
+    "Rule Japan 1948 1951 - Sep Sat>=8 25:00 0 S" to
376cc7
+    "Rule Japan 1948 1951 - Sep Sun>=9  1:00 0 S".
376cc7
+    This caters to zic before 2007 and to at least one Java-based zi
376cc7
+    compiler of uncertain vintage.  (Reported by Christos Zoulas.)
376cc7
+
376cc7
+
376cc7
 Release 2018f - 2018-10-18 00:14:18 -0700
376cc7
 
376cc7
   Briefly:
376cc7
diff --git a/ziguard.awk b/ziguard.awk
376cc7
index 42e2910..e3c7298 100644
376cc7
--- a/ziguard.awk
376cc7
+++ b/ziguard.awk
376cc7
@@ -80,6 +80,13 @@ DATAFORM != "main" {
376cc7
   if (comment_out) {
376cc7
     sub(/^/, "#")
376cc7
   }
376cc7
+
376cc7
+  # In rearguard format, change the Japan rule line with "Sat>=8 25:00"
376cc7
+  # to "Sun>=9 1:00", to cater to zic before 2007 and to older Java.
376cc7
+  if (!vanguard && $1 == "Rule" && $7 == "Sat>=8" && $8 == "25:00") {
376cc7
+    sub(/Sat>=8/, "Sun>=9")
376cc7
+    sub(/25:00/, " 1:00")
376cc7
+  }
376cc7
 }
376cc7
 
376cc7
 # If a Link line is followed by a Zone line for the same data, comment