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)
commitcd55adb09ee0d5e492e024cac7a43350933b9dd3 (patch)
treef1231d4506200338e0f8448539905205e09c5bdf /generic/tclCmdMZ.c
parent1cf40aa113542de5ca0aaa1b00b3a461cd72fceb (diff)
downloadtcl-cd55adb09ee0d5e492e024cac7a43350933b9dd3.zip
tcl-cd55adb09ee0d5e492e024cac7a43350933b9dd3.tar.gz
tcl-cd55adb09ee0d5e492e024cac7a43350933b9dd3.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) {