[tz] [PROPOSED] zic -r is incompatible with rolling leaps

Paul Eggert eggert at cs.ucla.edu
Mon Sep 13 01:43:41 UTC 2021


* NEWS, zic.8: Mention this.
* zic.c (leapadd): Report an error if the user tries it.
---
 NEWS  | 3 +++
 zic.8 | 3 +++
 zic.c | 4 ++++
 3 files changed, 10 insertions(+)

diff --git a/NEWS b/NEWS
index 1b5535a..62a7ba2 100644
--- a/NEWS
+++ b/NEWS
@@ -137,6 +137,9 @@ Unreleased, experimental changes
     last time transition disagreed with the TZ string, contrary to
     Internet RFC 8563 section 3.3.
 
+    zic -r now reports an error if given rolling leap seconds, as this
+    usage has never generally worked and is evidently unused.
+
     zic now generates a POSIX-conforming TZ string for TZif files
     where all-year DST is predicted for the indefinite future.
     For example, for all-year Eastern Daylight Time, zic now generates
diff --git a/zic.8 b/zic.8
index b77841b..3023ebe 100644
--- a/zic.8
+++ b/zic.8
@@ -709,6 +709,9 @@ or
 .q "Rolling"
 if the leap second time given by the other fields should be interpreted as
 local (wall clock) time.
+(Rolling leap seconds are not supported if the
+.B \*-r
+option is used.)
 .PP
 The expiration line, if present, has the form:
 .nf
diff --git a/zic.c b/zic.c
index e2a7e13..b06ef66 100644
--- a/zic.c
+++ b/zic.c
@@ -3144,6 +3144,10 @@ leapadd(zic_t t, int correction, int rolling)
 		error(_("too many leap seconds"));
 		exit(EXIT_FAILURE);
 	}
+	if (rolling && (lo_time != min_time || hi_time != max_time)) {
+	  error(_("Rolling leap seconds not supported with -r"));
+	  exit(EXIT_FAILURE);
+	}
 	for (i = 0; i < leapcnt; ++i)
 		if (t <= trans[i])
 			break;
-- 
2.30.2



More information about the tz mailing list