aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2020-10-22 21:15:22 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2020-10-22 21:15:22 -0400
commitc5054da0d7ee59a93ca6d7f7fc669ef0210dbad3 (patch)
treed6c61fd5d07f32e44aaa38e74c268a0356be17af /src
parentc16a1bbcf498f0aa053a3e55008f57d7f67357dd (diff)
downloadpostgresql-c5054da0d7ee59a93ca6d7f7fc669ef0210dbad3.tar.gz
postgresql-c5054da0d7ee59a93ca6d7f7fc669ef0210dbad3.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/timezone/README2
-rw-r--r--src/timezone/zic.c14
2 files changed, 13 insertions, 3 deletions
diff --git a/src/timezone/README b/src/timezone/README
index 10aeedce92a..f588d1f5add 100644
--- a/src/timezone/README
+++ b/src/timezone/README
@@ -55,7 +55,7 @@ match properly on the old version.
Time Zone code
==============
-The code in this directory is currently synced with tzcode release 2020c.
+The code in this directory is currently synced with tzcode release 2020d.
There are many cosmetic (and not so cosmetic) differences from the
original tzcode library, but diffs in the upstream version should usually
be propagated to our version. Here are some notes about that.
diff --git a/src/timezone/zic.c b/src/timezone/zic.c
index a1c64051f78..0ea6ead2db3 100644
--- a/src/timezone/zic.c
+++ b/src/timezone/zic.c
@@ -634,7 +634,8 @@ static const char *leapsec;
static const char *tzdefault;
/* -1 if the TZif output file should be slim, 0 if default, 1 if the
- output should be fat for backward compatibility. The default is slim. */
+ output should be fat for backward compatibility. ZIC_BLOAT_DEFAULT
+ determines the default. */
static int bloat;
static bool
@@ -787,7 +788,16 @@ main(int argc, char **argv)
if (optind == argc - 1 && strcmp(argv[optind], "=") == 0)
usage(stderr, EXIT_FAILURE); /* usage message by request */
if (bloat == 0)
- bloat = strcmp(ZIC_BLOAT_DEFAULT, "slim") == 0 ? -1 : 1;
+ {
+ static char const bloat_default[] = ZIC_BLOAT_DEFAULT;
+
+ if (strcmp(bloat_default, "slim") == 0)
+ bloat = -1;
+ else if (strcmp(bloat_default, "fat") == 0)
+ bloat = 1;
+ else
+ abort(); /* Configuration error. */
+ }
if (directory == NULL)
directory = "data";
if (tzdefault == NULL)