update Fri Feb 12 12:37:00 PST 2010
[pkgsrc.git] / sysutils / toshutils / patches / patch-ae
1 $NetBSD: patch-ae,v 1.2 2000/04/26 11:59:17 hubertf Exp $
2
3 --- src/parsetime.y.BAK Wed Apr 26 13:54:25 2000
4 +++ src/parsetime.y     Wed Apr 26 13:54:35 2000
5 @@ -1,6 +1,9 @@
6  %{
7  #include <time.h>
8  #include <stdlib.h>
9 +#ifdef __NetBSD__
10 +#include <stdio.h>
11 +#endif
12  #include <string.h>
13  #include "parsetime.h"
14  
15 @@ -290,6 +293,10 @@
16  
17  
18  time_t parsetime(int, char **);
19 +#ifdef __NetBSD__
20 +int yyparse __P((void));
21 +#endif
22 +
23  
24  time_t
25  parsetime(int argc, char **argv)
26 @@ -305,10 +312,24 @@
27      if (yyparse() == 0) {
28         exectime = mktime(&exectm);
29         if (isgmt) {
30 +#if __NetBSD__
31 +           struct tm *tm;
32 +           time_t t;
33 +
34 +           time(&t);
35 +           tm=localtime(&t);
36 +
37 +           exectime += timezone;
38 +           if (tm->tm_isdst) {
39 +               exectime -= 3600;
40 +           }
41 +#else
42 +       /* the "daylight" variable is not part of the ANSI C spec - HF */
43             exectime += timezone;
44             if (daylight) {
45                 exectime -= 3600;
46             }
47 +#endif
48         }
49         if (time_only && (currtime > exectime)) {
50             exectime += 24*3600;