Commit ce0e97f8 authored by Tom Lane's avatar Tom Lane

Sync our copy of the timezone library with IANA release tzcode2020c.

This changes zic's default output format from "-b fat" to "-b slim".
We were already using "slim" in v13/HEAD, so those branches drop
the explicit -b switch in the Makefiles.  Instead, add an explicit
"-b fat" in v12 and before, so that we don't change the output file
format in those branches.  (This is perhaps excessively conservative,
but we decided not to do so in a1207910, and I'll stick with that.)

Other non-cosmetic changes are to drop support for zic's long-obsolete
"-y" switch, and to ensure that strftime() does not change errno
unless it fails.

As usual with tzcode changes, back-patch to all supported branches.
parent 02a75f83
......@@ -56,7 +56,7 @@ zic: $(ZICOBJS) | submake-libpgport
install: all installdirs
ifeq (,$(with_system_tzdata))
$(ZIC) -d '$(DESTDIR)$(datadir)/timezone' -b slim $(ZIC_OPTIONS) $(TZDATAFILES)
$(ZIC) -d '$(DESTDIR)$(datadir)/timezone' $(ZIC_OPTIONS) $(TZDATAFILES)
endif
$(MAKE) -C tznames $@
......
......@@ -55,7 +55,7 @@ match properly on the old version.
Time Zone code
==============
The code in this directory is currently synced with tzcode release 2020a.
The code in this directory is currently synced with tzcode release 2020c.
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.
......
......@@ -128,12 +128,22 @@ size_t
pg_strftime(char *s, size_t maxsize, const char *format, const struct pg_tm *t)
{
char *p;
int saved_errno = errno;
enum warn warn = IN_NONE;
p = _fmt(format, t, s, s + maxsize, &warn);
if (!p)
{
errno = EOVERFLOW;
return 0;
}
if (p == s + maxsize)
{
errno = ERANGE;
return 0;
}
*p = '\0';
errno = saved_errno;
return p - s;
}
......
This diff is collapsed.
......@@ -369,7 +369,7 @@ sub GenerateTimezoneFiles
print "Generating timezone files...";
my @args = (
"$conf/zic/zic", '-d', "$target/share/timezone", '-b', 'slim');
"$conf/zic/zic", '-d', "$target/share/timezone");
foreach (@tzfiles)
{
my $tzfile = $_;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment