Skip to content

Commit

Permalink
Fix approxidate("never") to always return 0
Browse files Browse the repository at this point in the history
Commit af66366 introduced the keyword
"never" to be used with approxidate() but defined it with a fixed date
without taking care of timezone. As a result approxidate() will return
a timestamp in the future with a negative timezone.

With this patch, approxidate("never") always return 0 whatever your
timezone is.

Signed-off-by: Olivier Marin <dkr@freesurf.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Olivier Marin authored and Junio C Hamano committed Jun 17, 2008
1 parent 1d9b265 commit 8c6b578
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions date.c
Original file line number Diff line number Diff line change
Expand Up @@ -682,10 +682,8 @@ static void date_am(struct tm *tm, int *num)

static void date_never(struct tm *tm, int *num)
{
tm->tm_mon = tm->tm_wday = tm->tm_yday
= tm->tm_hour = tm->tm_min = tm->tm_sec = 0;
tm->tm_year = 70;
tm->tm_mday = 1;
time_t n = 0;
localtime_r(&n, tm);
}

static const struct special {
Expand Down

0 comments on commit 8c6b578

Please sign in to comment.