summaryrefslogtreecommitdiffstats
path: root/generic/tclExecute.c
diff options
context:
space:
mode:
authordgp <dgp@noemail.net>2006-05-04 12:34:36 (GMT)
committerdgp <dgp@noemail.net>2006-05-04 12:34:36 (GMT)
commit5dab7fb8ea32d29a436dfcac39b0b87a7ecf38a3 (patch)
tree924a385f237f2295aa51d8335ca9f18e50e50e33 /generic/tclExecute.c
parent5f8a8bd0b5b403f56e4125d5ab49081e659ffd59 (diff)
downloadtcl-5dab7fb8ea32d29a436dfcac39b0b87a7ecf38a3.zip
tcl-5dab7fb8ea32d29a436dfcac39b0b87a7ecf38a3.tar.gz
tcl-5dab7fb8ea32d29a436dfcac39b0b87a7ecf38a3.tar.bz2
* generic/tclExecute.c (ExprSrandFunc): Restore acceptance of wide
* tests/expr-old.test: integer values by srand() [Bug 1480509]. FossilOrigin-Name: bab9abe548fa45bbb19ee187b7df5c35733dbfd3
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r--generic/tclExecute.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 34e4ec1..4717ae2 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclExecute.c,v 1.94.2.18 2005/12/12 11:28:22 rmax Exp $
+ * RCS: @(#) $Id: tclExecute.c,v 1.94.2.19 2006/05/04 12:34:38 dgp Exp $
*/
#include "tclInt.h"
@@ -5578,17 +5578,17 @@ ExprSrandFunc(interp, eePtr, clientData)
}
if (Tcl_GetLongFromObj(NULL, valuePtr, &i) != TCL_OK) {
- /*
- * At this point, the only other possible type is double
- */
- Tcl_ResetResult(interp);
- Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
- "can't use floating-point value as argument to srand",
- (char *) NULL);
+ Tcl_WideInt w;
+
+ if (Tcl_GetWideIntFromObj(interp, valuePtr, &w) != TCL_OK) {
badValue:
- TclDecrRefCount(valuePtr);
- DECACHE_STACK_INFO();
- return TCL_ERROR;
+ Tcl_AddErrorInfo(interp, "\n (argument to \"srand()\")");
+ TclDecrRefCount(valuePtr);
+ DECACHE_STACK_INFO();
+ return TCL_ERROR;
+ }
+
+ i = Tcl_WideAsLong(w);
}
/*