1
0
mirror of https://frontier.innolan.net/rainlance/amiga-tz.git synced 2025-11-19 21:49:22 +00:00

3689 Commits

Author SHA1 Message Date
dff28f195b Fix a subscript error that accessed uninitialized data.
* localtime.c (tzload): The number of entries in 'types'
is timecnt, not typecnt.
* NEWS: Mention this.
Problem reported by Jörg Richter in:
http://mm.icann.org/pipermail/tz/2014-September/021561.html
2014-09-06 07:18:21 -07:00
488e7a8ed5 * europe (Asia/Novokuznetsk), NEWS: Fix misreading of Shanks. 2014-09-05 19:19:42 -07:00
7acb816290 * africa (Egypt): Fix date typo in comment. (Thanks to Marcel Telka.) 2014-09-03 17:29:34 -07:00
62d233adb3 * tz-art.html: Correct recently-introduced misspelling of "Schulz". 2014-08-29 17:39:18 -07:00
9cd0541edf Release tzcode2014g and tzdata2014g.
* NEWS, Makefile (VERSION): Increase to 2014g.
2014g
2014-08-28 12:32:04 -07:00
df374d40ff * localtime.c (tzset_unlocked): Don't return a void expression.
The C standard does not allow this, and Sun C 5.12 rejects it.
2014-08-27 14:16:34 -07:00
4cc7d12352 * NEWS: Fix misspelled identifier. (Thanks to Brian Inglis.) 2014-08-26 21:33:25 -07:00
2ba2b160d0 * NEWS: Reorganize recent code news clarity, and mention tzdist. 2014-08-26 18:49:54 -07:00
c72b41e2be * tz-link.htm: Retitle "formats" section to "protocols"
and update it in the light of the tzdist effort.
Mention Microsoft Windows alongside other OSes.
2014-08-26 18:48:14 -07:00
b465e56526 * tz-art.htm: Correct the Peanuts quote.
Fix broken links and remove a broken-linked book that wasn't
that notable anyway.  Use italics for book and movie titles.
2014-08-26 18:15:04 -07:00
fee8066ca3 * backzone: Spelling and accent fixes. 2014-08-26 16:01:25 -07:00
5e7e8dc1b0 * NEWS: Typo fix. 2014-08-26 15:14:48 -07:00
2423b5b4a3 Add documentation for the core NetBSD-inspired functions.
Lack of documentation reported by Jonathan Lennox in:
http://mm.icann.org/pipermail/tz/2014-August/021529.html
* newtzset.3: Document tzalloc and tzfree.
* newctime.3: Document localtime_rz and mktime_z.
* NEWS: Mention this.
2014-08-26 14:17:32 -07:00
9b7dd12d56 * zdump.c (main): Mention "FOO" if tzalloc("FOO") fails.
* NEWS: Document this.
2014-08-26 14:17:32 -07:00
3230f367b0 * localtime.c (zoneinit, tzalloc): Return NULL on failure.
Suggested by Jonathan Lennox in:
http://mm.icann.org/pipermail/tz/2014-August/021529.html
2014-08-26 14:17:32 -07:00
636f5e942c tzalloc(NULL) now acts like tzset() does when TZ is unset.
Suggested by Jonathan Lennox in:
http://mm.icann.org/pipermail/tz/2014-August/021529.html
* localtime.c (tzalloc): Treat NULL argument like tzsetwall.
(tzsetwall_unlocked): Remove, replacing with ...
(tzsetlcl): New function, which merges the old tzsetwall and
tzset_unlocked.
(zoneinit): Treat a null NAME like tzsetwall.
(tzsetwall, tzset_unlocked): Rewrite to use tzsetlcl.
* NEWS: Document this.
2014-08-26 14:17:27 -07:00
741377cc5d localtime.c: two minor 'bool' cleanups
These don't fix any bugs, but make the recently-introduced 'bool'
code easier to follow.
* localtime.c (gmtcheck): Move gmt_is_set's definition here,
since it's used only here.
(localtime_r): Explicitly convert integer to boolean rather
than relying on C99 semantics.
2014-08-26 11:21:38 -07:00
6a8cac5e89 * CONTRIBUTING: Prefer an https URL, as that's friendlier
to people without a GitHub.  (Thanks to Tony Finch.)
* NEWS: Add thanks, and spell it "GitHub".
2014-08-26 07:37:17 -07:00
c0e8e15430 * NEWS: Coalesce discussions of zdump, localtime_rz, and localtime_r. 2014-08-26 01:33:06 -07:00
bdad90f18f * Makefile, NEWS: Say that backzone's contents are not all low-quality
and give credit to Lester Caine for some of its high-quality entries.
2014-08-25 22:00:09 -07:00
bfc08e664e Port 'bool' usage to clang 3.4.
* date.c (convert, reset):
Fix prototype to match function, as the C standard requires.
2014-08-25 19:41:21 -07:00
7e8821934e Port C macro defaults to Solaris and Irix.
This is mostly for convenience, so that plain 'make' works out of
the box on Solaris, instead of having to run something awkward like
'make CFLAGS="-xc99=all -DHAVE_INCOMPATIBLE_CTIME_R=1"', and
similarly for Irix 6.5.
* private.h (_POSIX_PTHREAD_SEMANTICS):
* private.h, zdump.c (__EXTENSIONS__):
New macros, to make Solaris headers more like what we want out
of the box.
(LLONG_MAX, LLONG_MIN): Default from __LONG_LONG_MAX__ if it's defined.
This simplifies later code.
(SCNdFAST64, PRIdMAX): Don't assume they're defined when
INT_FAST64_MAX is, as that's not true on Solaris 10 + Sun C 5.12.
(PRIuMAX): Likewise, for Solaris 11 + Sun C 5.12.
* zdump.c (HAVE_LOCALTIME_RZ): Default to 1 only if TM_ZONE.
* Makefile, NEWS: Document this.
2014-08-25 14:46:05 -07:00
9701f8b9cd Port 'bool' usage to Sun C 5.12.
* zic.c (inzcont, inzone, is_alpha, yearistype):
Fix prototype to match function, as the C standard requires.
* NEWS: Mention the use of 'bool'.
2014-08-25 13:39:03 -07:00
82f519e703 Port 'make check_time_t_alternatives' to Solaris 10.
* Makefile (check_time_t_alternatives): Don't assume 'diff'
has the -q option, since POSIX does not require -q.
* NEWS: Document this.
2014-08-25 13:24:12 -07:00
2b935b775c Improve compatibility with NetBSD with respect to null pointers.
Problem reported by Alan Barrett in:
http://mm.icann.org/pipermail/tz/2014-August/021518.html
* localtime.c (zoneinit): Use UTC if !name.
That way, tzalloc(NULL) returns UTC, as in NetBSD.
(mktime_z): Use UTC if !sp.
* NEWS: Document this.
2014-08-25 08:20:53 -07:00
61bdeb997b zdump now uses localtime_rz if available.
This is significantly faster and is cleaner internally.
* Makefile, NEWS: Document this.
* zdump.c (NETBSD_INSPIRED): Default to 1.
(HAVE_LOCALTIME_RZ): New macro; defaults to NETBSD_INSPIRED && USE_LTZ.
(timezone_t) [!HAVE_LOCALTIME_RZ]: New macro, as a substitute.
(localtime_r) [!HAVE_LOCALTIME_RZ && (!HAVE_LOCALTIME_R||!HAVE_TZSET)]:
(localtime_rz, tzalloc, tzfree) [!HAVE_LOCALTIME_RZ]:
(mktime_rz) [!HAVE_LOCALTIME_RZ && TYPECHECK]:
New substitute function and macro, compatible with NetBSD.
All other uses of localtime_r changed to use localtime_rz.
(settimezone): Remove; all uses replaced by tzalloc.
(tzalloc): Use most of the code of the old settimezone function,
but don't free the old storage.
(tzfree): Free it here instead.
(my_localtime_rz): Rename from my_localtime_r, and make it
compatible with localtime_rz.  All uses changed.
(saveabbr): Return the abbreviation.  If HAVE_LOCALTIME_RZ
simply return the output of abbr; that's faster.
(main): Diagnose any tzalloc failure.  tzfree after use.
(hunt, show): New timezone_t arg.  All uses changed.
2014-08-25 08:20:53 -07:00
f99b8f1414 Add NetBSD-inspired functions for timezone_t objects.
* Makefile, NEWS: Document this.
* localtime.c (NETBSD_INSPIRED_EXTERN): New macro.
(zoneinit): New function, with tzset_unlocked's internals.
(tzset_unlocked): Use it.
(tzalloc, tzfree) [NETBSD_INSPIRED]: New functions.
(localsub, gmtsub, time2sub, time2, time1, leapcorr):
New time zone argument.  All uses changed.
(localsub, gmtsub): Cast to char *, since the time zone argument
is a pointer-to-const.
(localtime_rz): New function, with localtime_tzset's internals.
(localtime_tzset): Use it.
(mktime_z): New function, with mktime's internals.
(mktime): Use it.
(leapcorr): Pass time_t by value, not by reference.
(time2posix_z): New function, with time2posix's internals.
(time2posix): Use it.  Omit unnecessary local.
(posix2time_z): New function, with posix2time's internals.
(posix2time): Use it.
* private.h (NETBSD_INSPIRED): Default to 1.
(localtime_rz, mktime_z, timezone_t, strftime, tzalloc, tzfree):
Define if NETBSD_INSPIRED is defined.
Use macros to avoid any clashes with <time.h>.
(posiztime_z, time2posix_z): Likewise, but only if
STD_INSPIRED is also defined.
2014-08-25 08:20:53 -07:00
9f7d50ae1c Add strftime_l to the library. Only the C locale is supported.
* Makefile, NEWS: Document this.
* private.h (HAVE_STRFTIME_L): New macro.
* strftime.c (strftime_l) [HAVE_STRFTIME_L]: New function.
2014-08-25 08:20:53 -07:00
0e1d8b9d99 strftime: remove support for long-obsolete SunOS locale files
These files were removed from Solaris long ago,
and are not present on any current platforms.
* Makefile, NEWS: Document this.
* private.h (LOCALE_HOME): Remove.
* strftime.c: Assume LOCALE_HOME is not defined.
Do not include sys/stat.h.
(localebuf, _loc) [LOCALE_HOME]: Remove.  All uses removed.
2014-08-25 08:20:53 -07:00
98dea66f9a zdump: use tz library unless USE_LTZ is 0
This fixes some schizophrenia in the build, which linked zdump to
the tz library code but did not compile zdump with the tz library API.
* zdump.c (USE_LTZ): New macro.
Use it, not time_tz, to decide whether to include private.h.
* Makefile, NEWS: Document this.
* Makefile (CHECK_TIME_T_ALTERNATIVES): New macro.
(public): Use it.
2014-08-25 08:20:53 -07:00
da184ab535 mktime: guess better near transitions where tm_isdst does not change
* localtime.c (SMALLEST): New macro.
(time2sub) [TM_GMTOFF && !UNINIT_TRAP]:
If the UTC offset doesn't match the request, try the requested offset.
This catches a problem caught by -DTYPECHECK with a time stamp
near a transition from LMT to standard time, where both sides of
the transition have tm_isdst == 0.  If !defined TM_GMTOFF ||
UNINIT_TRAP you're out of luck: mktime will still conform
to its spec but it'll be more likely to guess wrong on these
ambiguous inputs.
* private.h (UNINIT_TRAP): New macro that defaults to 0.
* Makefile, NEWS: Document this.
2014-08-25 08:20:53 -07:00
7c681a8148 zdump: use localtime_r if available
This is a bit cleaner and faster.
* zdump.c (HAVE_LOCALTIME_R, HAVE_TZSET): Default to 1.
(tzset) [!HAVE_TZSET]:
(localtime_r) [!HAVE_LOCALTIME_R]: Provide a replacement.
(settimezone): Call tzset after changing environ.
(my_localtime_r): Rename from my_localtime, and change API to
be compatible with localtime_r, not localtime.  All uses changed.
* Makefile, NEWS: Document this.
2014-08-25 08:20:52 -07:00
ab1034cab1 zdump: don't use uninitialized storage
* zdump.c (main): Avoid use of uninitalized locals in rare cases.
* NEWS: Mention this.
2014-08-25 08:20:52 -07:00
d0aac72175 zdump: use TM_ZONE if available
* zdump.c (abbr): Return pointer-to-const.  Use TM_ZONE if
available, as it's simpler, more reliable, and a tad faster.
2014-08-25 08:20:52 -07:00
f50d254594 * Makefile (TZDOBJS): Remove ialloc.o.
* NEWS: Document this.
2014-08-25 08:20:52 -07:00
f4948756b5 Remove CMUCS's gtime function.
The Mach project has been inactive for decades,
and mktime has evidently replaced gtime.
* Makefile: Remove comment about CMUCS.
* localtime.c (gtime) [CMUCS]: Remove.
* NEWS: Document the above.
2014-08-25 08:20:52 -07:00
b5296f12c9 * localtime.c: Lessen lock overhead for gmtime etc.
(gmtcheck): Lock only if !gmt_is_set.
(gmtime_r, offtime, timeoff): Do not lock; gmtcheck now does this.
2014-08-25 08:20:52 -07:00
b3c8309836 * private.h (asctime_r): Qualify arguments with 'restrict'.
This is for compatibility with POSIX.
2014-08-25 08:20:52 -07:00
649397ecb4 Document thread-safe functions in man pages.
* NEWS, newctime.3, newstrftime.3, newtzset.3, time2posix.3:
Mention localtime_r etc.  Also, use function prototypes rather
than K&R style, and use 'restrict' where POSIX does.
2014-08-25 08:20:52 -07:00
730615ccad Improve commentary for time long ago in India.
* asia: Move commentary about Portuguese India from here ...
* backzone: ... to here. Add comment about 19th-century Madras time.
* NEWS: Document this.
2014-08-25 08:20:23 -07:00
9ccf0e74f1 zdump: Don't silently truncate too-long abbreviations.
Instead, allocate a longer buffer, exiting if memory is exhausted.
* zdump.c (saveabbr): New function.
(main, loab): Use it.
(abbr): Arg is now a pointer-to-const, for saveabbr.
2014-08-25 08:19:48 -07:00
161539d6d9 * zdump.c: Avoid crashes on unlikely integer overflows.
(longest): Now int, since it can't exceed INT_MAX.
(sumsize, settimezone): New functions.
(main): Don't let 'longest' exceed INT_MAX.  Use settimezone.
(show): Remove no-longer-necessary cast that formerly had undefined
behavior if 'longest' exceeded INT_MAX.
2014-08-25 08:19:48 -07:00
b2290be9d6 Prefer memcpy to strncpy when either will do.
* localtime.c (tzparse)
* zic.c (doabbr):
Use memcpy, as only nonzero bytes are being copied.
* zic.c (doabbr): Remove unnecessary test.
2014-08-25 08:19:48 -07:00
234c9c3b13 Fix unlikely buffer overrun when setting date across network.
* date.c (netsettime) [TSP_SETDATE]: Don't assume gethostname
returns a null-terminated string.
2014-08-25 08:19:48 -07:00
7eb7c7349c Use bool for boolean.
The tz source code predates C99 and so used int, 0 and 1 for boolean,
but nowadays bool is available and makes the code clearer.
Include backwards-compatibility definitions for pre-C99 platforms,
and don't go beyond what the backwards-compatibility defintions support.
* date.c (main, reset, sametm, convert, checkfinal, iffy, netsettime):
* localtime.c (struct ttinfo, struct state, gmt_is_set)
(differ_by_repeat, tzload, typesequiv, getoffset, transtime)
(tzparse, gmtload, tzsetwall_unlocked, tzset_unlocked, gmtcheck)
(localtime_tzset, timesub, increment_overflow)
(increment_overflow32, increment_overflow_time)
(normalize_overflow, normalize_overflow32, time2sub, time2)
(time1):
* strftime.c (_fmt, _yconv, _loc):
* zdump.c (warned, errout, is_alpha, my_localtime, abbrok)
(main, hunt, show):
* zic.c (struct rule, errors, warnings, leapseen, noise)
(leap_types, ttisstds, ttisgmts, error, warning, main, dolink)
(associate, infile, gethms, inzone, inzcont, inzsub, inleap)
(rulesub, is32, writezone, doabbr, stringoffset, stringrule)
(stringzone, outzone, addtype, leapadd, yearistype, is_space)
(is_alpha, ciequal, itsabbr, mkdirs):
Use bool for boolean.
* localtime.c (tzload, tzparse):
* zic.c (stringoffset, mkdirs):
Return true for success and false for failure instead of 0 and -1.
All callers changed.
* private.h, zdump.c (TRUE, FALSE): Remove, replacing by ...
(true, false, bool): Define by <stdbool.h> if C99 or later,
by macros otherwise.
* tzfile.h: Remove mention of TRUE and FALSE from commentary.
* zic.c (addtype): Remove now-unnecessary checks that a bool is a
boolean.
2014-08-25 08:19:48 -07:00
96eff14f85 Simplify configuration of TM_GMTOFF and TM_ZONE.
* private.h, zdump.c (_GNU_SOURCE): New macro.
(TM_GMTOFF) [!NO_TM_GMTOFF]:
(TM_ZONE) [!NO_TM_ZONE]: Guess definition if not already defined.
* Makefile, NEWS: Document the above.
2014-08-25 08:19:48 -07:00
2f7599d358 Port to GCC 3.4.6, which does not define __LONG_LONG_MIN__ on Irix.
* private.h (INT_FAST64_MIN, INTMAX_MIN): Don't use
__LONG_LONG_MIN__ when defining backwards-compatibility workaround.
2014-08-25 08:19:48 -07:00
1f5348d829 Minor library fixes for signed integer overflow.
* localtime.c (localsub, time2sub): Don't assume that signed
integer overflow wraps around.
2014-08-25 08:19:48 -07:00
13a277175c Fix some bugs and potential crashes with bad data in zone files.
* localtime.c (tzload): Avoid undefined behavior on integer overflow
when reading a file containing integers out of machine range.
Simplify some of the existing overflow checking.
Handle out-of-range leap-second transitions similarly to the
way we now handle out-of-range ordinary transitions.
* NEWS: Document this and other recent fixes.
2014-08-25 08:19:48 -07:00
10ac30643e * Makefile (check_time_t_alternatives): Pass REDO to submake. 2014-08-25 08:19:48 -07:00