summaryrefslogtreecommitdiff
path: root/sysutils/toshutils/patches/patch-ae
blob: aaaad2f555a3b79c755588c940ea46324ba056c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
$NetBSD: patch-ae,v 1.2 2000/04/26 11:59:17 hubertf Exp $

--- src/parsetime.y.BAK	Wed Apr 26 13:54:25 2000
+++ src/parsetime.y	Wed Apr 26 13:54:35 2000
@@ -1,6 +1,9 @@
 %{
 #include <time.h>
 #include <stdlib.h>
+#ifdef __NetBSD__
+#include <stdio.h>
+#endif
 #include <string.h>
 #include "parsetime.h"
 
@@ -290,6 +293,10 @@
 
 
 time_t parsetime(int, char **);
+#ifdef __NetBSD__
+int yyparse __P((void));
+#endif
+
 
 time_t
 parsetime(int argc, char **argv)
@@ -305,10 +312,24 @@
     if (yyparse() == 0) {
 	exectime = mktime(&exectm);
 	if (isgmt) {
+#if __NetBSD__
+	    struct tm *tm;
+	    time_t t;
+
+	    time(&t);
+	    tm=localtime(&t);
+
+	    exectime += timezone;
+	    if (tm->tm_isdst) {
+		exectime -= 3600;
+	    }
+#else
+	/* the "daylight" variable is not part of the ANSI C spec - HF */
 	    exectime += timezone;
 	    if (daylight) {
 		exectime -= 3600;
 	    }
+#endif
 	}
 	if (time_only && (currtime > exectime)) {
 	    exectime += 24*3600;