summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchengyemao <chengyemao>2005-05-22 01:30:44 (GMT)
committerchengyemao <chengyemao>2005-05-22 01:30:44 (GMT)
commit7fe8182aaad4c3615a5c4c9cd2594177f132f6d2 (patch)
tree4ba8e05af3e5be7bcc28edbcdf936be868069add
parentec92a2656e264a8588b743b96f52f8bcfeedc563 (diff)
downloadtcl-7fe8182aaad4c3615a5c4c9cd2594177f132f6d2.zip
tcl-7fe8182aaad4c3615a5c4c9cd2594177f132f6d2.tar.gz
tcl-7fe8182aaad4c3615a5c4c9cd2594177f132f6d2.tar.bz2
Fixed a bug in expr round(x) function: returned an empty string if x was an integer
-rw-r--r--generic/tclBasic.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index 3f4cda9..7637f62 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -13,7 +13,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclBasic.c,v 1.155 2005/05/19 15:18:02 dkf Exp $
+ * RCS: @(#) $Id: tclBasic.c,v 1.156 2005/05/22 01:30:44 chengyemao Exp $
*/
#include "tclInt.h"
@@ -5380,6 +5380,7 @@ ExprRoundFunc(clientData, interp, objc, objv)
}
if ((valuePtr->typePtr == &tclIntType) ||
(valuePtr->typePtr == &tclWideIntType)) {
+ Tcl_SetObjResult(interp, valuePtr);
return TCL_OK;
}
GET_DOUBLE_VALUE(d, valuePtr, valuePtr->typePtr);