summaryrefslogtreecommitdiffstats
path: root/generic/tclMain.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2005-09-15 16:40:02 (GMT)
committerdgp <dgp@users.sourceforge.net>2005-09-15 16:40:02 (GMT)
commitdad41b847302dce4ebd5139c0568aad2ad7a0776 (patch)
tree238980bfb093b32ba311f36a2774bde6bba0c4ee /generic/tclMain.c
parent75aee26af34aeea93c32910c88c0d5cef7077ff7 (diff)
downloadtcl-dad41b847302dce4ebd5139c0568aad2ad7a0776.zip
tcl-dad41b847302dce4ebd5139c0568aad2ad7a0776.tar.gz
tcl-dad41b847302dce4ebd5139c0568aad2ad7a0776.tar.bz2
* generic/tclBasic.c: More callers of TclObjPrintf and
* generic/tclCkalloc.c: TclFormatToErrorInfo. * generic/tclCmdMZ.c: * generic/tclExecute.c: * generic/tclIORChan.c: * generic/tclMain.c: * generic/tclProc.c: * generic/tclTimer.c: * generic/tclUtil.c: * unix/tclUnixFCmd.c * unix/configure: autoconf-2.59
Diffstat (limited to 'generic/tclMain.c')
-rw-r--r--generic/tclMain.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/generic/tclMain.c b/generic/tclMain.c
index f2954b6..75fa70b 100644
--- a/generic/tclMain.c
+++ b/generic/tclMain.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclMain.c,v 1.31 2005/07/21 14:38:49 dkf Exp $
+ * RCS: @(#) $Id: tclMain.c,v 1.32 2005/09/15 16:40:02 dgp Exp $
*/
#include "tclInt.h"
@@ -655,20 +655,21 @@ Tcl_Main(argc, argv, appInitProc)
/*
* Rather than calling exit, invoke the "exit" command so that users can
* replace "exit" with some other command to do additional cleanup on
- * exit. The Tcl_Eval call should never return.
+ * exit. The Tcl_EvalObjEx call should never return.
*/
if (!Tcl_InterpDeleted(interp)) {
if (!Tcl_LimitExceeded(interp)) {
- char buffer[TCL_INTEGER_SPACE + 5];
-
- sprintf(buffer, "exit %d", exitCode);
- Tcl_Eval(interp, buffer);
+ Tcl_Obj *cmd = Tcl_NewObj();
+ TclObjPrintf(NULL, cmd, "exit %d", exitCode);
+ Tcl_IncrRefCount(cmd);
+ Tcl_EvalObjEx(interp, cmd, TCL_EVAL_GLOBAL);
+ Tcl_DecrRefCount(cmd);
}
/*
- * If Tcl_Eval returns, trying to eval [exit], something unusual is
- * happening. Maybe interp has been deleted; maybe [exit] was
+ * If Tcl_EvalObjEx returns, trying to eval [exit], something unusual
+ * is happening. Maybe interp has been deleted; maybe [exit] was
* redefined, maybe we've blown up because of an exceeded limit. We
* still want to cleanup and exit.
*/