From b6a8aeca928debd8853b94a6307f5f0e03c51e27 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Wed, 30 Mar 2022 11:28:59 -0700
Subject: [PROPOSED] Improve Morocco 2087 rearguard workaround

* ziguard.awk: In the Morocco rearguard workaround, add a day of
"DST" on 2087-05-11, switching to standard time (without changing
the UTC offset) the next day.  The idea is to work around a
problem with the DST offset finding logic on Android.
Problem reported by Almaz Mingaleev.
---
 ziguard.awk | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/ziguard.awk b/ziguard.awk
index 2be6d52..6856a49 100644
--- a/ziguard.awk
+++ b/ziguard.awk
@@ -104,7 +104,11 @@ DATAFORM != "main" {
   }
   if (!vanguard && $1 == "Rule" && $2 == "Morocco" && 2019 <= $3) {
     if ($9 == "0") {
-      last_std_date = $3 " " $6 " " $7 "  " $8
+      # Add a day, to insert an extra transition to work around a bug
+      # in Android's DST offset finding logic circa 2022.  See:
+      # https://mm.icann.org/pipermail/tz/2022-March/031352.html
+      # This does not affect the UTC offset, only the DST flag for that day.
+      last_std_date = $3 " " $6 " " ($7 + 1) "  " $8
       sub(/\t0\t/, "\t1:00\t")
     } else {
       sub(/\t-1:00\t/, "\t0\t")
-- 
2.35.1

