explicitly prefer 64-bit/v2 zoneinfo tables
authorRich Felker <dalias@aerifal.cx>
Sun, 22 Nov 2020 22:00:01 +0000 (17:00 -0500)
committerRich Felker <dalias@aerifal.cx>
Sun, 22 Nov 2020 22:00:01 +0000 (17:00 -0500)
since commit 38143339646a4ccce8afe298c34467767c899f51, the condition
sizeof(time_t) > 4 is always true, so there is no functional change
being made here. but semantically, the 64-bit tables should always be
preferred now, because upstream zic (zoneinfo compiler) has quietly
switched to emitting empty 32-bit tables by default, and the resulting
backwards-incompatible zoneinfo files will be encountered in the wild.

src/time/__tz.c

index dd2c42c..2eb6ab4 100644 (file)
@@ -185,7 +185,7 @@ static void do_tzset()
        zi = map;
        if (map) {
                int scale = 2;
-               if (sizeof(time_t) > 4 && map[4]=='2') {
+               if (map[4]=='2') {
                        size_t skip = zi_dotprod(zi+20, VEC(1,1,8,5,6,1), 6);
                        trans = zi+skip+44+44;
                        scale++;