1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-04-12 06:57:33 +02:00
Commit Graph

54 Commits

Author SHA1 Message Date
Jim Meyering
7549c10f35 (get_date): Reuse tm_isdst of first localtime
call; this is an improvement on a bug fix suggested by
martin@dresden.nacamar.de.  Do not assume that localtime and
gmtime return non-null.
From Paul Eggert.
1999-03-28 20:58:51 +00:00
Jim Meyering
fce748fe1f <alloca.h>: Include if HAVE_ALLOCA_H, not FORCE_ALLOCA_H.
The FORCE_ALLOCA_H was a relic of the bad old pre-autoconf Emacs days.
1999-02-19 07:31:48 +00:00
Jim Meyering
50225cad77 Fix warnings from gcc -W -Wall
(__attribute__): Define.
(ATTRIBUTE_UNUSED): Define.
(yyerror): Mark parameter as unused with ATTRIBUTE_UNUSED.
(MonthDayTable): Add initializers for last entry.
(UnitsTable): Likewise.
(OtherTable): Likewise.
(MilitaryTable): Likewise.
1998-12-31 14:37:21 +00:00
Jim Meyering
7024c7d55c s/get-date.h/getdate.h/ 1998-03-14 16:31:51 +00:00
Jim Meyering
f8d66bde6a s/getdate.h/get-date.h/ 1998-02-20 21:42:11 +00:00
Jim Meyering
0fdd1b9130 Add %expect directive.
Move inclusion of getdate.h and dependent extern declarations down
so getdate.h's prototype follows the sometimes-enabled definition
of `const' to nothing.  Otherwise, the prototype wouldn't match
the definition because of the defined-away `const'.
(get_date): ANSI-fy definition.
From Kaveh Ghazi.
1998-01-06 23:53:33 +00:00
Jim Meyering
2c0e561933 (OtherTable): Interpret `next' as 1 (not 2) units.
Patch from Richard Sharman <rsharman@magmacom.com>.
1997-06-01 17:15:51 +00:00
Jim Meyering
7f74dcb1a6 s/;/. in comment to placate francois 1997-04-10 03:46:01 +00:00
Jim Meyering
8c93627ccb (tYEAR_UNIT): Increase yyRelYear by $1, not just by 1.
From Andreas Schwab.
1997-02-27 05:53:15 +00:00
Jim Meyering
db78b4797a (tMONTH_UNIT): Increase yyRelMonth by $1, not just by 1.
(tDAY_UNIT): Likewise for yyRelDay.
(tHOUR_UNIT): Likewise for yyRelHour.
(tMINUTE_UNIT): Likewise for yyRelMinutes.
(tSEC_UNIT): Likewise for yyRelSeconds.
1997-02-22 20:13:19 +00:00
Jim Meyering
b969dad022 Indent with GNU indent. 1997-01-18 20:17:39 +00:00
Jim Meyering
c1db691c12 Indent 2 more cpp-directives to reflect nesting. 1997-01-18 20:12:10 +00:00
Jim Meyering
5f9c33edfe (get_date): Change prototype to reflect const'ness of parameters.
Indent cpp-directives to reflect nesting.
1997-01-18 20:11:05 +00:00
Jim Meyering
6e5149f0ab 1997-01-06 Paul Eggert <eggert@twinsun.com>
* getdate.y: Rewrite to use mktime.

<sys/timeb.h>: Don't include.
(mktime): Declare.

(struct timeb, timezone, DOOMSDAY, SECSPERDAY, DSTMODE, yyDSTmode,
ToSeconds, Convert, DSTcorrect, RelativeDate, RelativeMonth): Remove.
(ToHour): New function (part of the old ToSeconds fn).
(ToYear): New function (part of the old Convert fn).

(TABLE.value, yyDayOrdinal, yyDayNumber, yyTimezone, yyDay, yyHour,
yyMinutes, yyMonth, yySeconds, yyYear, yyRelMonth, yyRelSeconds,
Number): Now int instead of time_t.
(HOUR): Don't cast to time_t.

(tDAY_UNIT, tHOUR_UNIT, tYEAR_UNIT): New %tokens.
(UnitsTable): Use new units that are closer to the keywords.

(yyRelDay, yyRelHour, yyRelMinutes, yyRelYear): New variables.
(rel, relunit, get_date): Add support for them.

(time): Fix timezone calculations for negative half-hour offsets
when integer division truncates towards minus infinity.

(zone): Incorporiate DST calculation directly.

(get_date): 2nd arg is now time_t *, not struct timeb *.
Use mktime to do most of the work, instead of computing it ourselves.
Guard against falsely reporting errors near the time_t boundaries
when parsing times in other time zones.
1997-01-18 15:32:16 +00:00
Jim Meyering
859f8587f8 add blank line. 1996-12-18 03:28:09 +00:00
Jim Meyering
86d6c36d09 (IN_CTYPE_DOMAIN): Rename from ISASCII.
(ISDIGIT): New definition from Paul Eggert.
This one evaluates its argument exactly once.
(yylex): Move increment out of ISALPHA argument.  Use a
comma-expression instead.
1996-12-13 03:05:00 +00:00
Jim Meyering
8f477a9072 (Convert): Don't reject all dates in 2038.
Some fit in 31 bits.
1996-12-10 04:34:18 +00:00
Jim Meyering
807b8b05c2 (date): Interpret the date, L/M/N, as YYYY/MM/DD
if L >= 1000, otherwise as MM/DD/YY.  With this change,
date --date=DATE accepts dates like those in an RCS log listing.
1996-12-01 19:15:03 +00:00
Jim Meyering
b5a71af82a Remap yacc globals to have gd_ prefix.
Suggestion to do as in gdb/c-exp.y from Tom Tromey.
1996-11-01 00:32:12 +00:00
Jim Meyering
d2c6e7cba9 Define and use upper case variants of ctype.h IS* macros.
From Bruno Haible.
1996-09-07 17:42:58 +00:00
Jim Meyering
9379b5aed5 Merge changes from FSF. 1996-03-10 05:00:20 +00:00
Jim Meyering
aaa9cb7c22 (RelativeMonth): Add 1900 to the year so that relative date specs
that push the year through the end of the century work.  For example,
`date -d "01/01/1998 3 years" +%Y' now prints 2001.
From Peter Dalgaard (pd@kubism.ku.dk).
1996-03-06 04:57:01 +00:00
Jim Meyering
7c342fe2a1 Add FIXME comments. 1995-08-07 16:07:28 +00:00
Jim Meyering
a2e52e58b1 (Convert): Use 2037 as threshold, not 1999.
Otherwise years after 1999 are treated as invalid.
From Andreas Schwab.
1995-06-07 18:10:17 +00:00
Jim Meyering
b38a5a7a17 . 1995-01-27 15:01:25 +00:00
Jim Meyering
4ecaaf1fa7 . 1995-01-27 15:00:54 +00:00
Jim Meyering
66444bdafb Remove/rewrite some comments. 1995-01-27 05:36:14 +00:00
Jim Meyering
b554fee401 . 1995-01-27 05:22:23 +00:00
Jim Meyering
d734172c73 merge with 1.10q 1994-10-08 00:40:55 +00:00
Jim Meyering
e13a0b7f49 merge with 1.10n1 1994-09-27 20:52:02 +00:00
Jim Meyering
451fa3013e . 1994-09-25 01:25:18 +00:00
Jim Meyering
1ba691350b merge with 1.10m 1994-09-24 19:12:46 +00:00
Jim Meyering
73b9e4b762 merge with 1.10j 1994-09-17 02:46:48 +00:00
Jim Meyering
00dceaff2e merge with 1.10i 1994-09-08 04:48:40 +00:00
Jim Meyering
de8c62d0f0 merge with 1.10h 1994-09-01 23:20:29 +00:00
Jim Meyering
085c609f77 merge with 1.9.4g 1994-04-25 18:34:37 +00:00
Jim Meyering
256a906698 merge with 1.9.4f 1994-04-25 16:34:49 +00:00
Jim Meyering
7c68f857d0 Revert 1.14-1.16 changes that removed difftm and modified get_date. 1994-04-24 12:48:45 +00:00
Jim Meyering
33955663ad merge with 1.9.4e 1994-04-19 13:40:42 +00:00
Jim Meyering
e614cf3cbb . 1994-04-19 02:30:46 +00:00
Jim Meyering
4caa3d07cf merge with 1.9.2g 1994-02-10 19:14:24 +00:00
Jim Meyering
5fbc4e2384 merge with 1.9.2a 1993-12-23 00:38:35 +00:00
Jim Meyering
d7daf7444e . 1993-12-23 00:08:23 +00:00
Jim Meyering
39fd5971dd merge with 1.9 1993-11-10 06:05:02 +00:00
Jim Meyering
a1b9bc9a42 merge with 1.9 1993-11-09 13:21:32 +00:00
Jim Meyering
d463bda066 merge with 1.8.1c 1993-10-12 02:42:06 +00:00
Jim Meyering
87fa23e641 merge with 1.8.1b 1993-10-12 01:52:24 +00:00
Jim Meyering
5bf316d15e . 1993-10-04 21:22:19 +00:00
Jim Meyering
3134fad324 merge with 1.8.1a 1993-10-04 21:20:37 +00:00
Jim Meyering
ae0074289c merge with 1.8.1 + partial --version and --help 1993-09-08 18:23:12 +00:00