diff options
author | dgp <dgp@users.sourceforge.net> | 2009-09-18 21:13:40 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2009-09-18 21:13:40 (GMT) |
commit | cd55adb09ee0d5e492e024cac7a43350933b9dd3 (patch) | |
tree | f1231d4506200338e0f8448539905205e09c5bdf | |
parent | 1cf40aa113542de5ca0aaa1b00b3a461cd72fceb (diff) | |
download | tcl-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).
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | generic/tclCmdMZ.c | 6 |
2 files changed, 9 insertions, 3 deletions
@@ -1,3 +1,9 @@ +2009-09-18 Don Porter <dgp@users.sourceforge.net> + + * generic/tclCmdMZ.c (Tcl_SubstObj): Pass 'length' values to + recursive parsing calls to convert O(N^2) operations of [subst] + to O(N). + 2009-08-25 Andreas Kupries <andreask@activestate.com> * generic/tclBasic.c (Tcl_CreateInterp, Tcl_EvalTokensStandard, 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) { |