summaryrefslogtreecommitdiffstats
path: root/generic/tclCmdMZ.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2002-04-05 19:26:34 (GMT)
committerdgp <dgp@users.sourceforge.net>2002-04-05 19:26:34 (GMT)
commitb1d0f3126ec21021d3ddfe55871c4e366887e0b5 (patch)
treed3e09b315235fa448b73c898e119e8b389ae0325 /generic/tclCmdMZ.c
parent7964355d7cac82483f0b85355050cb0d919a96fb (diff)
downloadtcl-b1d0f3126ec21021d3ddfe55871c4e366887e0b5.zip
tcl-b1d0f3126ec21021d3ddfe55871c4e366887e0b5.tar.gz
tcl-b1d0f3126ec21021d3ddfe55871c4e366887e0b5.tar.bz2
* Corrected [subst] so that return codes
TCL_BREAK and TCL_CONTINUE returned by variable substitution have the same effect as when those codes are returned by command substitution. [Bug 536879]
Diffstat (limited to 'generic/tclCmdMZ.c')
-rw-r--r--generic/tclCmdMZ.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c
index 0721ac0..63da4d3 100644
--- a/generic/tclCmdMZ.c
+++ b/generic/tclCmdMZ.c
@@ -14,7 +14,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclCmdMZ.c,v 1.65 2002/03/29 22:47:23 hobbs Exp $
+ * RCS: @(#) $Id: tclCmdMZ.c,v 1.66 2002/04/05 19:26:35 dgp Exp $
*/
#include "tclInt.h"
@@ -2525,10 +2525,16 @@ Tcl_SubstObj(interp, objPtr, flags)
p += parse.tokenPtr->size;
code = Tcl_EvalTokensStandard(interp, parse.tokenPtr,
parse.numTokens);
- if (code != TCL_OK) {
+ if (code == TCL_ERROR) {
goto errorResult;
}
- Tcl_AppendObjToObj(resultObj, Tcl_GetObjResult(interp));
+ if (code == TCL_BREAK) {
+ Tcl_ResetResult(interp);
+ return resultObj;
+ }
+ if (code != TCL_CONTINUE) {
+ Tcl_AppendObjToObj(resultObj, Tcl_GetObjResult(interp));
+ }
Tcl_ResetResult(interp);
old = p;
} else {