Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3d13a83

Browse files
committed
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 dropthe explicit -b switch in the Makefiles. Instead, add an explicit"-b fat" in v12 and before, so that we don't change the output fileformat in those branches. (This is perhaps excessively conservative,but we decided not to do so ina120791, 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 errnounless it fails.As usual with tzcode changes, back-patch to all supported branches.
1 parent7004ce7 commit3d13a83

File tree

5 files changed

+81
-141
lines changed

5 files changed

+81
-141
lines changed

‎src/timezone/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ zic: $(ZICOBJS) | submake-libpgport
5555

5656
install: all installdirs
5757
ifeq (,$(with_system_tzdata))
58-
$(ZIC) -d '$(DESTDIR)$(datadir)/timezone' -p '$(POSIXRULES)' $(ZIC_OPTIONS) $(TZDATAFILES)
58+
$(ZIC) -d '$(DESTDIR)$(datadir)/timezone' -p '$(POSIXRULES)'-b fat$(ZIC_OPTIONS) $(TZDATAFILES)
5959
endif
6060
$(MAKE) -C tznames $@
6161

‎src/timezone/README

Lines changed: 1 addition & 1 deletion
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 release2020a.
58+
The code in this directory is currently synced with tzcode release2020c.
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/strftime.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,22 @@ size_t
128128
pg_strftime(char*s,size_tmaxsize,constchar*format,conststructpg_tm*t)
129129
{
130130
char*p;
131+
intsaved_errno=errno;
131132
enumwarnwarn=IN_NONE;
132133

133134
p=_fmt(format,t,s,s+maxsize,&warn);
135+
if (!p)
136+
{
137+
errno=EOVERFLOW;
138+
return0;
139+
}
134140
if (p==s+maxsize)
141+
{
142+
errno=ERANGE;
135143
return0;
144+
}
136145
*p='\0';
146+
errno=saved_errno;
137147
returnp-s;
138148
}
139149

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp