# HG changeset patch # User jwe # Date 1191265109 0 # Node ID 3d555cd5ad0f92aaafe14cbcdb8704506a4f7ad7 # Parent cf41866340d377bc2492b82e9d42a182c260076d [project @ 2007-10-01 18:58:29 by jwe] diff -r cf41866340d3 -r 3d555cd5ad0f ChangeLog --- a/ChangeLog Mon Oct 01 18:13:21 2007 +0000 +++ b/ChangeLog Mon Oct 01 18:58:29 2007 +0000 @@ -1,3 +1,9 @@ +2007-10-01 John W. Eaton + + * aclocal.m4 (OCTAVE_CHECK_STRPTIME): Delete. + * configure.in: Don't use OCTAVE_CHECK_STRPTIME, simply check for + strptime. + 2007-09-18 Thomas Treichl * aclocal.m4 (OCTAVE_CHECK_STRPTIME): New macro. diff -r cf41866340d3 -r 3d555cd5ad0f aclocal.m4 --- a/aclocal.m4 Mon Oct 01 18:13:21 2007 +0000 +++ b/aclocal.m4 Mon Oct 01 18:58:29 2007 +0000 @@ -987,67 +987,6 @@ if test "$octave_cv_hdf5_dll" = yes; then AC_DEFINE(_HDF5USEDLL_, 1, [Define if using HDF5 dll (Win32)]) fi]) -dnl -dnl Check to see if the function 'strptime' fills all fields of the tm -dnl structure correctly or if some systems maybe forget about the tm_wday -dnl and tm_yday fields (see inline comments below) -dnl -AC_DEFUN([OCTAVE_CHECK_STRPTIME],[ - AC_CHECK_FUNC(strptime) - if test "$ac_cv_func_strptime" == yes; then - AC_MSG_CHECKING([whether strptime works]) - AC_CACHE_VAL([octave_cv_strptime],[ - AC_TRY_RUN([#include - #include - - int main (int argc, char *argv[]) { - - struct tm tm; - time_t t; - - /* Checks for a handle error if return value == NULL, if so then - return an error number immediately */ - if (strptime("17-09-2007 12:10:20", "%d-%m-%Y %H:%M:%S", &tm) == NULL) { - /* printf ("strptime: An handle error occured\n"); */ - return (1); - } - /* printf("year: %d; month: %d; day: %d;\n", - tm.tm_year, tm.tm_mon, tm.tm_mday); - printf("hour: %d; minute: %d; second: %d\n", - tm.tm_hour, tm.tm_min, tm.tm_sec); - printf("strptime: week day: %d, year day: %d\n", - tm.tm_wday, tm.tm_yday); */ - - /* The hard coded date from above is a 'Monday' and the day - number '259' of the year 2007, so tm_wday == 1 and - tm_yday == 259, if these values are not set then return - the error number 1 */ - if (tm.tm_year != 107) return (1); - if (tm.tm_mon != 8) return (1); - if (tm.tm_mday != 17) return (1); - if (tm.tm_hour != 12) return (1); - if (tm.tm_min != 10) return (1); - if (tm.tm_sec != 20) return (1); - /* On some system eg. MacOSX and Cygwin the following two fields - may be zero, ie. the function does not work as expected */ - if (tm.tm_wday != 1) return (1); - if (tm.tm_yday != 259) return (1); - - /* If not already returned from this test program then function - seems to work correctly */ - return (0); - }],[octave_cv_strptime=yes],[octave_cv_strptime=no],[octave_cv_strptime=no] - ) # end of TRY_RUN - ]) # end of CACHE_VAL - - AC_MSG_RESULT([$octave_cv_strptime]) - if test x$octave_cv_strptime = xyes - then - AC_DEFINE(HAVE_STRPTIME, 1, - [Define to 1 if you have a working `strptime' function.]) - fi - fi # if test "$ac_cv_func_strptime" == yes; then -]) # end of AC_DEFUN of OCTAVE_CHECK_STRPTIME dnl dnl Check for the QHull version. dnl diff -r cf41866340d3 -r 3d555cd5ad0f configure.in --- a/configure.in Mon Oct 01 18:13:21 2007 +0000 +++ b/configure.in Mon Oct 01 18:58:29 2007 +0000 @@ -29,7 +29,7 @@ EXTERN_CXXFLAGS="$CXXFLAGS" AC_INIT -AC_REVISION($Revision: 1.575 $) +AC_REVISION($Revision: 1.576 $) AC_PREREQ(2.57) AC_CONFIG_SRCDIR([src/octave.cc]) AC_CONFIG_HEADER(config.h) @@ -1437,7 +1437,7 @@ readlink realpath rename resolvepath rindex rmdir round select setgrent \ setlocale setpwent setvbuf sigaction siglongjmp sigpending sigprocmask \ sigsuspend snprintf stat strcasecmp strdup strerror stricmp \ - strncasecmp strnicmp strsignal symlink tempnam umask \ + strncasecmp strnicmp strptime strsignal symlink tempnam umask \ uname unlink usleep utime vfprintf vsprintf vsnprintf waitpid \ _chmod _snprintf x_utime _utime32) @@ -1452,8 +1452,6 @@ ;; esac -OCTAVE_CHECK_STRPTIME - OCTAVE_SMART_PUTENV case "$canonical_host_type" in diff -r cf41866340d3 -r 3d555cd5ad0f liboctave/ChangeLog --- a/liboctave/ChangeLog Mon Oct 01 18:13:21 2007 +0000 +++ b/liboctave/ChangeLog Mon Oct 01 18:58:29 2007 +0000 @@ -1,5 +1,9 @@ 2007-10-01 John W. Eaton + * oct-time.cc (octave_strptime::init): Call mktime to propertly + initialize wday and yday. + From Matthias Drochner . + * cmd-edit.cc (command_editor::do_decode_prompt_string): Don't insert extra '\001' when decoding \[ and \]. diff -r cf41866340d3 -r 3d555cd5ad0f liboctave/oct-time.cc --- a/liboctave/oct-time.cc Mon Oct 01 18:13:21 2007 +0000 +++ b/liboctave/oct-time.cc Mon Oct 01 18:58:29 2007 +0000 @@ -27,6 +27,7 @@ #include #include +#include #ifdef HAVE_UNISTD_H #ifdef HAVE_SYS_TYPES_H @@ -355,6 +356,10 @@ char *q = oct_strptime (p, fmt.c_str (), &t); + // Fill in wday and yday. + t.tm_isdst = -1; + mktime (&t); + if (q) nchars = q - p + 1; else diff -r cf41866340d3 -r 3d555cd5ad0f src/ChangeLog --- a/src/ChangeLog Mon Oct 01 18:13:21 2007 +0000 +++ b/src/ChangeLog Mon Oct 01 18:58:29 2007 +0000 @@ -48,6 +48,7 @@ 2007-09-25 Matthias Drochner * syscalls.cc (Fpopen2): Doc fix. + Use "sort -r" instead of "sort -nr" in test. 2007-09-18 John W. Eaton