From 1f6174e4660ddaf10fdb0e2d6168a3f3dc9227ac Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Wed, 7 Aug 2002 22:04:01 +0000 Subject: (main): Adjust to posixtime signature change. --- src/date.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/date.c b/src/date.c index ca541b193..bce6a29fa 100644 --- a/src/date.c +++ b/src/date.c @@ -411,7 +411,7 @@ argument must be a format string beginning with `+'."), } else { - bool invalid_date = false; + bool valid_date = true; status = 0; if (!option_specified_date && !set_date) @@ -422,11 +422,11 @@ argument must be a format string beginning with `+'."), given in the POSIX-format. */ set_date = 1; datestr = argv[optind]; - when.tv_sec = posixtime (datestr, - (PDS_TRAILING_YEAR - | PDS_CENTURY | PDS_SECONDS)); + valid_date = posixtime (&when.tv_sec, + datestr, + (PDS_TRAILING_YEAR + | PDS_CENTURY | PDS_SECONDS)); when.tv_nsec = 0; /* FIXME: posixtime should set this. */ - invalid_date = (when.tv_sec == (time_t) -1); format = NULL; } else @@ -452,13 +452,13 @@ argument must be a format string beginning with `+'."), { when.tv_sec = get_date (datestr, NULL); when.tv_nsec = 0; /* FIXME: get_date should set this. */ - invalid_date = (when.tv_sec == (time_t) -1); + valid_date = (when.tv_sec != (time_t) -1); } format = (n_args == 1 ? argv[optind] + 1 : NULL); } - if (invalid_date) + if (! valid_date) error (1, 0, _("invalid date `%s'"), datestr); if (set_date) -- cgit v1.2.3-54-g00ecf