summaryrefslogtreecommitdiffstats
path: root/generic/tclCmdMZ.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2009-09-18 21:13:40 (GMT)
committerdgp <dgp@users.sourceforge.net>2009-09-18 21:13:40 (GMT)
commit2aa45635bb65ab27ecc692076b072560a603d4d3 (patch)
treef1231d4506200338e0f8448539905205e09c5bdf /generic/tclCmdMZ.c
parentcd0b1e67a2c3e8b74aa134359931b2ad464f8caf (diff)
downloadtcl-2aa45635bb65ab27ecc692076b072560a603d4d3.zip
tcl-2aa45635bb65ab27ecc692076b072560a603d4d3.tar.gz
tcl-2aa45635bb65ab27ecc692076b072560a603d4d3.tar.bz2
* generic/tclCmdMZ.c (Tcl_SubstObj): Pass 'length' values to
recursive parsing calls to convert O(N^2) operations of [subst] to O(N).
Diffstat (limited to 'generic/tclCmdMZ.c')
-rw-r--r--generic/tclCmdMZ.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c
index ef172fc..a082820 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.82.2.30 2009/08/25 20:59:10 andreas_kupries Exp $
+ * RCS: @(#) $Id: tclCmdMZ.c,v 1.82.2.31 2009/09/18 21:13:41 dgp Exp $
*/
#include "tclInt.h"
@@ -2623,7 +2623,7 @@ Tcl_SubstObj(interp, objPtr, flags)
* unsubstituted characters straight through if a '$'
* does not precede a variable name.)
*/
- if (Tcl_ParseVarName(interp, p, -1, &parse, 0) != TCL_OK) {
+ if (Tcl_ParseVarName(interp, p, length, &parse, 0) != TCL_OK) {
goto errorResult;
}
if (parse.numTokens == 1) {
@@ -2670,7 +2670,7 @@ Tcl_SubstObj(interp, objPtr, flags)
iPtr->numLevels++;
code = TclInterpReady(interp);
if (code == TCL_OK) {
- code = Tcl_EvalEx(interp, p+1, -1, 0);
+ code = Tcl_EvalEx(interp, p+1, length-1, 0);
}
iPtr->numLevels--;
switch (code) {