summaryrefslogtreecommitdiff
path: root/math/octave/patches/patch-ai
blob: ebd53a0ad34884cb53dca6f9b0c3247c5e3407c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
$NetBSD: patch-ai,v 1.3 2008/01/11 01:23:44 adam Exp $

--- liboctave/oct-time.cc.orig	2007-12-10 07:26:20.000000000 +0100
+++ liboctave/oct-time.cc
@@ -34,6 +34,8 @@ along with Octave; see the file COPYING.
 #include <unistd.h>
 #endif
 
+#include <time.h>
+
 #if defined (OCTAVE_USE_WINDOWS_API)
 #include <windows.h>
 #undef min
@@ -355,6 +357,9 @@ octave_strptime::init (const std::string
   char *p = strsave (str.c_str ());
 
   char *q = oct_strptime (p, fmt.c_str (), &t);
+  /* fill in wday and yday */
+  t.tm_isdst = -1;
+  mktime(&t);
 
   // Fill in wday and yday, but only if mday is valid and the mon and year
   // are filled in, avoiding issues with mktime and invalid dates.