diff options
author | dgp <dgp@noemail.net> | 2005-09-15 16:40:01 (GMT) |
---|---|---|
committer | dgp <dgp@noemail.net> | 2005-09-15 16:40:01 (GMT) |
commit | 7ac19490ef0760cddfffa5aa0f1fcbc5006d9ceb (patch) | |
tree | 238980bfb093b32ba311f36a2774bde6bba0c4ee /generic/tclMain.c | |
parent | 3a4014fcc5ad0930f992d27f5a10f28f1b1e77d1 (diff) | |
download | tcl-7ac19490ef0760cddfffa5aa0f1fcbc5006d9ceb.zip tcl-7ac19490ef0760cddfffa5aa0f1fcbc5006d9ceb.tar.gz tcl-7ac19490ef0760cddfffa5aa0f1fcbc5006d9ceb.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
FossilOrigin-Name: cf51f10457c93581fd543b8f9cb1e38a71139466
Diffstat (limited to 'generic/tclMain.c')
-rw-r--r-- | generic/tclMain.c | 17 |
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. */ |