Jim Meyering c66dd95e8e Fix some minor time-related bugs with POSIX time arguments.
Some valid time stamps were being rejected (notably -1, and
time stamps before 1900 on 64-bit hosts).  And some invalid
time stamps were being accepted, e.g. September 31.

* lib/posixtm.h (posixtime): Return bool instead of time_t, so
that we can return (time_t) -1 successfully.
* lib/posixtm.c: Likewise.
[HAVE_STDBOOL_H]: Include <stdbool.h>.
(bool, false, true) [!HAVE_STDBOOL_H]: New type.
(t): Remove static var.
(year, posix_time_parse): Now takes struct tm * arg to modify, instead
of static var.  All uses changed.
(year): Do not reject years before 1900; they can occur with
64-bit time_t.
(posix_time_parse): Do not check for out-of-range components;
that is now the caller's responsibility, since our checks were
only approximations.
(posixtime): Use mktime to check for out-of-range components,
since it knows them exactly.
If mktime returns (time_t) -1, check whether an error actually occurred
by invoking localtime on -1.
(main) [TEST_POSIXTIME]: Check for input data errors, and report
posixtime failures better.
Improve the test data (in comments only).
2002-08-07 22:02:23 +00:00
..
2000-08-26 12:04:46 +00:00
2000-11-03 08:44:12 +00:00
2001-07-15 15:13:14 +00:00
.
2000-10-22 13:03:06 +00:00
2002-02-26 15:38:49 +00:00
2002-02-26 15:38:49 +00:00
2001-08-13 06:30:10 +00:00
2001-11-17 13:29:42 +00:00
2000-05-06 14:33:46 +00:00
2002-01-16 22:44:43 +00:00
2000-08-07 17:03:20 +00:00
2002-07-01 14:19:20 +00:00
2002-06-22 09:03:14 +00:00
.
2002-07-27 21:39:33 +00:00
2002-02-16 14:10:17 +00:00
2001-03-03 19:05:36 +00:00
2001-11-17 13:29:42 +00:00
2001-11-17 13:29:42 +00:00
2002-06-22 09:25:36 +00:00
2002-06-22 09:25:36 +00:00
2001-11-17 13:29:42 +00:00
2000-04-30 16:25:24 +00:00
2002-06-22 08:55:43 +00:00
2001-03-03 19:05:36 +00:00
2001-08-31 07:34:41 +00:00
2002-01-16 22:43:41 +00:00
2000-06-21 09:56:42 +00:00
2001-08-12 13:02:20 +00:00
2001-08-12 13:02:20 +00:00
2000-04-18 13:41:26 +00:00
2001-11-17 13:29:42 +00:00
2001-12-09 22:08:19 +00:00
2000-06-21 09:09:57 +00:00
2002-07-20 06:31:12 +00:00
2001-11-17 13:29:42 +00:00
2000-07-09 07:22:43 +00:00
2001-10-05 11:44:30 +00:00
2001-10-05 11:44:30 +00:00
2001-12-19 15:05:33 +00:00
2002-02-16 14:10:17 +00:00
.
2002-07-28 21:45:04 +00:00
2000-11-05 15:04:39 +00:00
2001-08-04 17:07:37 +00:00
2001-11-17 13:29:42 +00:00
2000-11-27 09:33:53 +00:00
2000-10-28 08:22:11 +00:00
2000-10-28 08:24:44 +00:00
2001-09-16 12:42:14 +00:00
2001-11-17 10:59:01 +00:00
2000-11-18 09:53:33 +00:00
2001-08-12 18:49:13 +00:00
2000-12-19 08:22:18 +00:00
2002-02-16 08:13:08 +00:00
2002-02-16 08:13:08 +00:00
2001-01-26 11:15:37 +00:00
2000-10-17 08:45:07 +00:00
2002-01-22 08:02:22 +00:00
2000-04-18 17:28:34 +00:00
2001-11-17 13:29:42 +00:00
2000-04-04 12:50:44 +00:00
2000-04-04 12:50:59 +00:00
2001-12-08 06:57:58 +00:00
2001-12-15 16:57:15 +00:00
2001-05-12 15:48:00 +00:00
2000-10-22 06:57:42 +00:00
2001-08-31 09:09:35 +00:00
2000-07-09 07:22:43 +00:00
2002-03-01 23:20:20 +00:00
2001-11-17 13:29:42 +00:00
2000-09-20 08:06:06 +00:00
2001-03-03 19:05:36 +00:00
2000-11-17 08:19:01 +00:00
2001-08-26 07:28:06 +00:00
2002-01-16 22:38:26 +00:00
2002-03-01 23:16:55 +00:00
2001-03-03 19:05:36 +00:00
2002-01-16 22:38:04 +00:00
2001-08-31 07:35:47 +00:00
2002-01-22 08:02:55 +00:00
2002-01-22 08:02:55 +00:00
2001-09-04 20:21:54 +00:00
2002-07-15 12:59:47 +00:00
2001-08-26 07:03:07 +00:00
2001-11-17 13:29:42 +00:00

The files in this directory are shared between the fileutils, sh-utils,
and textutils packages.  Not all files are used by each package.
The autoconf tests required for these files are in ../m4.

The library name, fetish, is a permutation of the first two
letters of each of the package names: FIleutils, TExtutils, SH-utils.