Index: tests/expr.test =================================================================== RCS file: /cvsroot/tcl/tests/expr.test,v retrieving revision 1.5.4.1 diff -c -r1.5.4.1 expr.test *** expr.test 1999/09/22 04:12:57 1.5.4.1 --- expr.test 1999/10/14 21:28:27 *************** *** 647,652 **** --- 647,655 ---- catch {expr int($x)} expr {$x} } 11 + test expr-18.2 {whitespace strings should not be == 0 (buggy strtod)} { + expr {" "} + } { } # Check "expr" and interpreter result object resetting before appending # an error msg during evaluation of exprs not in {}s Index: unix/configure.in =================================================================== RCS file: /cvsroot/tcl/unix/configure.in,v retrieving revision 1.48.2.1 diff -c -r1.48.2.1 configure.in *** configure.in 1999/09/30 21:27:05 1.48.2.1 --- configure.in 1999/10/14 21:28:29 *************** *** 248,253 **** --- 248,283 ---- fi #-------------------------------------------------------------------- + # Check for buggy strtod function. On Compaq's Tru64 Unix 5.0, + # strtod(" ") returns 0.0 instead of a failure to convert. + #-------------------------------------------------------------------- + + AC_CHECK_FUNC(strtod, tcl_strtod=1, tcl_strtod=0) + if test "$tcl_strtod" = 1; then + AC_MSG_CHECKING([for Tru64 strtod bug]) + AC_TRY_RUN([ + extern double strtod(); + int main() + { + char *string = " "; + char *term; + double value; + value = strtod(string, &term); + if (term == (string+1)) { + exit(1); + } + exit(0); + }], tcl_ok=1, tcl_ok=0, tcl_ok=0) + if test "$tcl_ok" = 1; then + AC_MSG_RESULT(ok) + else + AC_MSG_RESULT(buggy) + test -n "$verbose" && echo " Adding strtod.o." + LIBOBJS="$LIBOBJS strtod.o" + fi + fi + + #-------------------------------------------------------------------- # Under Solaris 2.4, strtod returns the wrong value for the # terminating character under some conditions. Check for this # and if the problem exists use a substitute procedure