Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 0e55153

Browse files
committed
Sync our copy of the timezone library with IANA release tzcode2020d.
There's no functional change at all here, but I'm curious to see whether this change successfully shuts up Coverity's warning about a useless strcmp(), which appeared with the previous update. Discussion: http://mm.icann.org/pipermail/tz/2020-October/029370.html
1 parent 2e4af41 commit 0e55153

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/timezone/README

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ match properly on the old version.
5555
Time Zone code
5656
==============
5757

58-
The code in this directory is currently synced with tzcode release 2020c.
58+
The code in this directory is currently synced with tzcode release 2020d.
5959
There are many cosmetic (and not so cosmetic) differences from the
6060
original tzcode library, but diffs in the upstream version should usually
6161
be propagated to our version. Here are some notes about that.

src/timezone/zic.c

+12-2
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,8 @@ static const char *leapsec;
634634
static const char *tzdefault;
635635

636636
/* -1 if the TZif output file should be slim, 0 if default, 1 if the
637-
output should be fat for backward compatibility. The default is slim. */
637+
output should be fat for backward compatibility. ZIC_BLOAT_DEFAULT
638+
determines the default. */
638639
static int bloat;
639640

640641
static bool
@@ -787,7 +788,16 @@ main(int argc, char **argv)
787788
if (optind == argc - 1 && strcmp(argv[optind], "=") == 0)
788789
usage(stderr, EXIT_FAILURE); /* usage message by request */
789790
if (bloat == 0)
790-
bloat = strcmp(ZIC_BLOAT_DEFAULT, "slim") == 0 ? -1 : 1;
791+
{
792+
static char const bloat_default[] = ZIC_BLOAT_DEFAULT;
793+
794+
if (strcmp(bloat_default, "slim") == 0)
795+
bloat = -1;
796+
else if (strcmp(bloat_default, "fat") == 0)
797+
bloat = 1;
798+
else
799+
abort(); /* Configuration error. */
800+
}
791801
if (directory == NULL)
792802
directory = "data";
793803
if (tzdefault == NULL)

0 commit comments

Comments
 (0)