diff options
Diffstat (limited to 'generic/tclBasic.c')
-rw-r--r-- | generic/tclBasic.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 83bc4a6..f6e5235 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.113 2004/09/08 17:04:01 dgp Exp $ + * RCS: @(#) $Id: tclBasic.c,v 1.114 2004/09/17 22:59:14 dgp Exp $ */ #include "tclInt.h" @@ -3308,6 +3308,9 @@ Tcl_LogCommandInfo(interp, script, command, length) Tcl_AppendToObj(message, "\"", -1); TclAppendObjToErrorInfo(interp, message); Tcl_DecrRefCount(message); + if (!(iPtr->flags & ERROR_CODE_SET)) { + Tcl_SetErrorCode(interp, "NONE", NULL); + } iPtr->flags &= ~ERR_ALREADY_LOGGED; } @@ -4766,11 +4769,15 @@ Tcl_AddObjErrorInfo(interp, message, length) /* * If the errorCode variable wasn't set by the code that generated * the error, set it to "NONE". + * + * NOTE: The main check for setting the default value of + * errorCode to NONE is in Tcl_LogCommandInfo. This one + * should go away, but currently it's taking care of setting + * up errorCode after compile errors. */ if (!(iPtr->flags & ERROR_CODE_SET)) { - Tcl_ObjSetVar2(interp, iPtr->execEnvPtr->errorCode, NULL, - Tcl_NewStringObj("NONE", -1), TCL_GLOBAL_ONLY); + Tcl_SetErrorCode(interp, "NONE", NULL); } } |