blob: 8e5e8eaa33c5986e0e67d871dea733360fb79e4e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
$NetBSD: patch-ad,v 1.1.1.1 2007/04/24 16:34:02 dmcmahill Exp $
--- date.c.orig 2007-03-05 02:15:33.000000000 +0000
+++ date.c
@@ -768,13 +768,15 @@ unsigned long approxidate(const char *da
int number = 0;
struct tm tm, now;
struct timeval tv;
+ time_t tt;
char buffer[50];
if (parse_date(date, buffer, sizeof(buffer)) > 0)
return strtoul(buffer, NULL, 10);
gettimeofday(&tv, NULL);
- localtime_r(&tv.tv_sec, &tm);
+ localtime_r(&tt, &tm);
+ tv.tv_sec = tt;
now = tm;
for (;;) {
unsigned char c = *date;
|