diff options
author | hobbs <hobbs> | 2002-07-26 21:41:48 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2002-07-26 21:41:48 (GMT) |
commit | 0e05c188c12ae4f7e25c3a3d8ca1892bba59c243 (patch) | |
tree | 2be25626803c655641b1c0d420c2bcfb2deee9d8 | |
parent | f63b5e89f17fa39c82ffbe4e7139a146d845f31d (diff) | |
download | tcl-0e05c188c12ae4f7e25c3a3d8ca1892bba59c243.zip tcl-0e05c188c12ae4f7e25c3a3d8ca1892bba59c243.tar.gz tcl-0e05c188c12ae4f7e25c3a3d8ca1892bba59c243.tar.bz2 |
* generic/tclVar.c (TclLookupVar): removed early returns that
prevented the parens from being restored. also removed goto label
as it was not necessary.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | generic/tclVar.c | 26 |
2 files changed, 17 insertions, 15 deletions
@@ -1,3 +1,9 @@ +2002-07-26 Jeff Hobbs <jeffh@ActiveState.com> + + * generic/tclVar.c (TclLookupVar): removed early returns that + prevented the parens from being restored. also removed goto label + as it was not necessary. + 2002-07-24 Miguel Sofer <msofer@users.sourceforge.net> * generic/tclExecute.c: diff --git a/generic/tclVar.c b/generic/tclVar.c index cf45c5c..4dcd4c4 100644 --- a/generic/tclVar.c +++ b/generic/tclVar.c @@ -15,7 +15,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.60 2002/07/17 20:42:27 msofer Exp $ + * RCS: @(#) $Id: tclVar.c,v 1.61 2002/07/26 21:41:48 hobbs Exp $ */ #include "tclInt.h" @@ -240,11 +240,10 @@ TclLookupVar(interp, part1, part2, flags, msg, createPart1, createPart2, p--; if (*p == ')') { if (part2 != NULL) { - openParen = NULL; if (flags & TCL_LEAVE_ERR_MSG) { VarErrMsg(interp, part1, part2, msg, needArray); } - goto done; + return NULL; } closeParen = p; *openParen = 0; @@ -263,20 +262,17 @@ TclLookupVar(interp, part1, part2, flags, msg, createPart1, createPart2, if ((errMsg != NULL) && (flags & TCL_LEAVE_ERR_MSG)) { VarErrMsg(interp, part1, elName, msg, errMsg); } - return NULL; - } - - while (TclIsVarLink(varPtr)) { - varPtr = varPtr->value.linkPtr; - } - if (elName == NULL) { - return varPtr; + } else { + while (TclIsVarLink(varPtr)) { + varPtr = varPtr->value.linkPtr; + } + if (elName != NULL) { + *arrayPtrPtr = varPtr; + varPtr = TclLookupArrayElement(interp, part1, elName, flags, + msg, createPart1, createPart2, varPtr); + } } - *arrayPtrPtr = varPtr; - varPtr = TclLookupArrayElement(interp, part1, elName, flags, - msg, createPart1, createPart2, varPtr); - done: if (openParen != NULL) { *openParen = '('; *closeParen = ')'; |