diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | generic/tclVar.c | 9 |
2 files changed, 9 insertions, 7 deletions
@@ -1,3 +1,10 @@ +2009-03-18 Don Porter <dgp@users.sourceforge.net> + + * generic/tclVar.c (TclLookupSimpleVar): Shift all calls to + Tcl_SetErrorCode() out of TclLookupSimpleVar and onto its callers, + where control with TCL_LEAVE_ERR_MSG flag is more easily handled. + [Bug 2689307] + 2009-03-16 Donal K. Fellows <dkf@users.sf.net> * generic/tclCmdMZ.c (TryPostBody): [Bug 2688063]: Extract information diff --git a/generic/tclVar.c b/generic/tclVar.c index 0af352c..e61e06e 100644 --- a/generic/tclVar.c +++ b/generic/tclVar.c @@ -16,7 +16,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclVar.c,v 1.176 2009/02/10 23:08:57 nijtmans Exp $ + * RCS: @(#) $Id: tclVar.c,v 1.177 2009/03/18 16:52:20 dgp Exp $ */ #include "tclInt.h" @@ -972,13 +972,9 @@ TclLookupSimpleVar( flags, &varNsPtr, &dummy1Ptr, &dummy2Ptr, &tail); if (varNsPtr == NULL) { *errMsgPtr = badNamespace; - Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "VARNAME", - NULL); return NULL; } else if (tail == NULL) { *errMsgPtr = missingName; - Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "VARNAME", - NULL); return NULL; } if (tail != varName) { @@ -1001,7 +997,6 @@ TclLookupSimpleVar( } } else { /* Var wasn't found and not to create it. */ *errMsgPtr = noSuchVar; - Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "VARNAME", NULL); return NULL; } } @@ -1038,7 +1033,6 @@ TclLookupSimpleVar( } if (varPtr == NULL) { *errMsgPtr = noSuchVar; - Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "VARNAME", NULL); } } } @@ -3621,6 +3615,7 @@ TclPtrObjMakeUpvar( myFlags|AVOID_RESOLVERS, /* create */ 1, &errMsg, &index); if (varPtr == NULL) { TclObjVarErrMsg(interp, myNamePtr, NULL, "create", errMsg, -1); + Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "VARNAME", NULL); return TCL_ERROR; } } |