summaryrefslogtreecommitdiffstats
path: root/generic/tclEnsemble.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2016-06-28 22:49:22 (GMT)
committerdgp <dgp@users.sourceforge.net>2016-06-28 22:49:22 (GMT)
commitd2629fb2726fa18af638288c9c9aa89369b9fade (patch)
tree5a668f6c4e6abf7a07037bf9a931592971a77f11 /generic/tclEnsemble.c
parent2880e7da55a9d5ff7d8ba8fed48743f0e15733a4 (diff)
parentedc450c53752cf92b00a45883fee2d66a2bde27c (diff)
downloadtcl-d2629fb2726fa18af638288c9c9aa89369b9fade.zip
tcl-d2629fb2726fa18af638288c9c9aa89369b9fade.tar.gz
tcl-d2629fb2726fa18af638288c9c9aa89369b9fade.tar.bz2
merge 8.6
Diffstat (limited to 'generic/tclEnsemble.c')
-rw-r--r--generic/tclEnsemble.c22
1 files changed, 3 insertions, 19 deletions
diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c
index 986b7c1..fd2fa67 100644
--- a/generic/tclEnsemble.c
+++ b/generic/tclEnsemble.c
@@ -1826,7 +1826,6 @@ NsEnsembleImplementationCmdNR(
Tcl_Obj *copyPtr; /* The actual list of words to dispatch to.
* Will be freed by the dispatch engine. */
int prefixObjc, copyObjc;
- Interp *iPtr = (Interp *) interp;
/*
* Get the prefix that we're rewriting to. To do this we need to
@@ -1870,25 +1869,10 @@ NsEnsembleImplementationCmdNR(
* count both as inserted and removed arguments.
*/
- if (iPtr->ensembleRewrite.sourceObjs == NULL) {
- iPtr->ensembleRewrite.sourceObjs = objv;
- iPtr->ensembleRewrite.numRemovedObjs =
- 2 + ensemblePtr->numParameters;
- iPtr->ensembleRewrite.numInsertedObjs =
- prefixObjc + ensemblePtr->numParameters;
+ if (TclInitRewriteEnsemble(interp, 2 + ensemblePtr->numParameters,
+ prefixObjc + ensemblePtr->numParameters, objv)) {
TclNRAddCallback(interp, TclClearRootEnsemble, NULL, NULL, NULL,
NULL);
- } else {
- register int ni = 2 + ensemblePtr->numParameters
- - iPtr->ensembleRewrite.numInsertedObjs;
- /* Position in objv of new front of insertion
- * relative to old one. */
- if (ni > 0) {
- iPtr->ensembleRewrite.numRemovedObjs += ni;
- iPtr->ensembleRewrite.numInsertedObjs += prefixObjc-1;
- } else {
- iPtr->ensembleRewrite.numInsertedObjs += prefixObjc-2;
- }
}
/*
@@ -2007,7 +1991,7 @@ TclInitRewriteEnsemble(
if (numIns < numRemoved) {
iPtr->ensembleRewrite.numRemovedObjs += numRemoved - numIns;
- iPtr->ensembleRewrite.numInsertedObjs += numInserted - 1;
+ iPtr->ensembleRewrite.numInsertedObjs = numInserted;
} else {
iPtr->ensembleRewrite.numInsertedObjs += numInserted - numRemoved;
}