# HG changeset patch # User John W. Eaton # Date 1285032190 14400 # Node ID 0de4eff677d6b5f96ef4eea771dc32b77d834cb5 # Parent 594adb99a25ed595c8440fb87d2735cd229da552 use mktime module from gnulib diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2010-09-20 John W. Eaton + + * bootstrap.conf (gnulib_modules): Include mktime in the list. + 2010-09-18 John W. Eaton * Makefile.am (BUILT_SOURCES): Include run-octave in the list. diff --git a/bootstrap.conf b/bootstrap.conf --- a/bootstrap.conf +++ b/bootstrap.conf @@ -31,6 +31,7 @@ lstat mkdir mkfifo + mktime nanosleep pathmax progname diff --git a/liboctave/ChangeLog b/liboctave/ChangeLog --- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,8 @@ +2010-09-20 John W. Eaton + + * oct-time.cc (octave_time::octave_time, octave_strptime::init): + Call gnulib::mktime instead of mktime (may fix bug #31079). + 2010-09-15 Jaroslav Hajek * dSparse.h (SparseMatrix::SparseMatrix (const Sparse&)): diff --git a/liboctave/oct-time.cc b/liboctave/oct-time.cc --- a/liboctave/oct-time.cc +++ b/liboctave/oct-time.cc @@ -58,7 +58,7 @@ t.tm_zone = ps; #endif - ot_unix_time = mktime (&t); + ot_unix_time = gnulib::mktime (&t); #if defined (HAVE_STRUCT_TM_TM_ZONE) delete [] ps; @@ -272,7 +272,7 @@ if (t.tm_mday != 0 && t.tm_mon >= 0 && t.tm_year != INT_MIN) { t.tm_isdst = -1; - mktime (&t); + gnulib::mktime (&t); } if (t.tm_mon < 0) diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2010-09-20 John W. Eaton + + * DLD-FUNCTIONS/time.cc (Fmktime): New tests (bug #31079). + 2010-09-20 John W. Eaton Bug #31085: diff --git a/src/DLD-FUNCTIONS/time.cc b/src/DLD-FUNCTIONS/time.cc --- a/src/DLD-FUNCTIONS/time.cc +++ b/src/DLD-FUNCTIONS/time.cc @@ -279,6 +279,12 @@ %!error mktime (1, 2, 3); +%% These tests fail on systems with mktime functions of limited +%% intelligence: +%!assert (datestr (datenum (1969, 1, 1), 0), "01-Jan-1969 00:00:00") +%!assert (datestr (datenum (1901, 1, 1), 0), "01-Jan-1901 00:00:00") +%!assert (datestr (datenum (1795, 1, 1), 0), "01-Jan-1795 00:00:00") + */ DEFUN_DLD (strftime, args, ,