50 lines
975 B
Text
50 lines
975 B
Text
$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;
|