diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2006-04-25 10:29:47 +0000 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2006-04-25 10:29:47 +0000 |
commit | 972d0198a9ddf434b81cf7392f6617a5170edfb3 (patch) | |
tree | 1aba3062191c9b6f8c8018f71ce2a6703a530351 /lib | |
parent | dfef85e7539331fc35abb152c28eaf9b04f2389e (diff) | |
download | coreutils-972d0198a9ddf434b81cf7392f6617a5170edfb3.tar.xz |
(get_date): When adding relative date, start with the
initial time, not with the result of the first mktime call.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ChangeLog | 5 | ||||
-rw-r--r-- | lib/getdate.y | 6 |
2 files changed, 10 insertions, 1 deletions
diff --git a/lib/ChangeLog b/lib/ChangeLog index b5ebafdd0..372138072 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,8 @@ +2006-04-25 Paul Eggert <eggert@cs.ucla.edu> + + * getdate.y (get_date): When adding relative date, start with the + initial time, not with the result of the first mktime call. + 2006-04-17 Paul Eggert <eggert@cs.ucla.edu> * filemode.c: Include "filemode.h" first, to test the interface. diff --git a/lib/getdate.y b/lib/getdate.y index dafc0eae4..cfa299f38 100644 --- a/lib/getdate.y +++ b/lib/getdate.y @@ -1,7 +1,7 @@ %{ /* Parse a string into an internal time stamp. - Copyright (C) 1999, 2000, 2002, 2003, 2004, 2005 Free Software + Copyright (C) 1999, 2000, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify @@ -1437,6 +1437,10 @@ get_date (struct timespec *result, char const *p, struct timespec const *now) tm.tm_year = year; tm.tm_mon = month; tm.tm_mday = day; + tm.tm_hour = tm0.tm_hour; + tm.tm_min = tm0.tm_min; + tm.tm_sec = tm0.tm_sec; + tm.tm_isdst = tm0.tm_isdst; Start = mktime (&tm); if (Start == (time_t) -1) goto fail; |