diff options
author | dgp <dgp@users.sourceforge.net> | 2004-10-25 17:24:29 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2004-10-25 17:24:29 (GMT) |
commit | a982cad7ac7f927864d62b50b62a961526b15852 (patch) | |
tree | 04439c9dabfd93c314ca69f45c1840b0e40d8ac4 /generic | |
parent | 75edfbbf9073ea32340ab1a7315f01b8077fd1ba (diff) | |
download | tcl-a982cad7ac7f927864d62b50b62a961526b15852.zip tcl-a982cad7ac7f927864d62b50b62a961526b15852.tar.gz tcl-a982cad7ac7f927864d62b50b62a961526b15852.tar.bz2 |
* library/auto.tcl Purged Tcl's script library of all
* library/clock.tcl remaining references to global vars
* library/init.tcl ::errorInfo and ::errorCode.
* generic/tclMain.c (Tcl_Main): Updated to make use of
TclGetReturnOptions instead of ::errorInfo variable.
* generic/tclInterp.c (tclInit): Bug fix. Access dict variables
with [dict get], not array syntax.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclInterp.c | 7 | ||||
-rw-r--r-- | generic/tclMain.c | 20 |
2 files changed, 15 insertions, 12 deletions
diff --git a/generic/tclInterp.c b/generic/tclInterp.c index 51ce8fd..4ee52f6 100644 --- a/generic/tclInterp.c +++ b/generic/tclInterp.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: tclInterp.c,v 1.47 2004/10/15 04:01:32 dgp Exp $ + * RCS: @(#) $Id: tclInterp.c,v 1.48 2004/10/25 17:24:37 dgp Exp $ */ #include "tclInt.h" @@ -84,10 +84,11 @@ static char initScript[] = "if {[info proc tclInit]==\"\"} {\n\ set tcl_library $i\n\ set tclfile [file join $i init.tcl]\n\ if {[file exists $tclfile]} {\n\ - if {![catch {uplevel #0 [list source $tclfile]} msg opt]} {\n\ + if {![catch {uplevel #0 [list source $tclfile]} msg opts]} {\n\ return\n\ } else {\n\ - append errors \"$tclfile: $msg\n$opt(-errorinfo)\n\"\n\ + append errors \"$tclfile: $msg\n\"\n\ + append errors \"[dict get $opts -errorinfo]\n\"\n\ }\n\ }\n\ }\n\ diff --git a/generic/tclMain.c b/generic/tclMain.c index 238b485..7869cec 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.28 2004/10/15 04:01:32 dgp Exp $ + * RCS: @(#) $Id: tclMain.c,v 1.29 2004/10/25 17:24:39 dgp Exp $ */ #include "tclInt.h" @@ -435,17 +435,19 @@ Tcl_Main(argc, argv, appInitProc) if (code != TCL_OK) { errChannel = Tcl_GetStdChannel(TCL_STDERR); if (errChannel) { + Tcl_Obj *options = TclGetReturnOptions(interp, code); + Tcl_Obj *keyPtr = Tcl_NewStringObj("-errorinfo", -1); + Tcl_Obj *valuePtr; - /* - * The following statement guarantees that the errorInfo - * variable is set properly when the error has to do with - * the opening or reading of the file. - */ + Tcl_IncrRefCount(keyPtr); + Tcl_DictObjGet(NULL, options, keyPtr, &valuePtr); + Tcl_DecrRefCount(keyPtr); - Tcl_AddErrorInfo(interp, ""); - Tcl_WriteObj(errChannel, Tcl_GetVar2Ex(interp, "errorInfo", - NULL, TCL_GLOBAL_ONLY)); + if (valuePtr) { + Tcl_WriteObj(errChannel, valuePtr); + } Tcl_WriteChars(errChannel, "\n", 1); + Tcl_DecrRefCount(options); } exitCode = 1; } |