diff options
author | dgp <dgp@users.sourceforge.net> | 2003-04-25 21:21:07 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2003-04-25 21:21:07 (GMT) |
commit | 9e3a21b5ebf1b620acfd51cef82cd549b83ed815 (patch) | |
tree | 8baae502219aec48239052914fce46566fca4013 | |
parent | bb1ae65db1a29d83933c869fec4200fddf6c615a (diff) | |
download | tcl-9e3a21b5ebf1b620acfd51cef82cd549b83ed815.zip tcl-9e3a21b5ebf1b620acfd51cef82cd549b83ed815.tar.gz tcl-9e3a21b5ebf1b620acfd51cef82cd549b83ed815.tar.bz2 |
* generic/tclBasic.c: Tcl_EvalObjv() failed to honor the
TCL_EVAL_GLOBAL flag when resolving command names. Tcl_EvalEx
passed a string rep including leading whitespace and comments
to TclEvalObjvInternal().
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | generic/tclBasic.c | 12 |
2 files changed, 15 insertions, 4 deletions
@@ -1,3 +1,10 @@ +2003-04-25 Don Porter <dgp@users.sourceforge.net> + + * generic/tclBasic.c: Tcl_EvalObjv() failed to honor the + TCL_EVAL_GLOBAL flag when resolving command names. Tcl_EvalEx + passed a string rep including leading whitespace and comments + to TclEvalObjvInternal(). + 2003-04-25 Andreas Kupries <andreask@activestate.com> * win/tclWinThrd.c: Applied SF patch #727271. This patch changes diff --git a/generic/tclBasic.c b/generic/tclBasic.c index cf9df21..6605ed7 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclBasic.c,v 1.75 2003/02/18 02:37:52 msofer Exp $ + * RCS: @(#) $Id: tclBasic.c,v 1.75.2.1 2003/04/25 21:21:25 dgp Exp $ */ #include "tclInt.h" @@ -3003,10 +3003,14 @@ TclEvalObjvInternal(interp, objc, objv, command, length, flags) * word array with "unknown" as the first word and the original * command words as arguments. Then call ourselves recursively * to execute it. + * + * If caller requests, or if we're resolving the target end of + * an interpeter alias (TCL_EVAL_INVOKE), be sure to do command + * name resolution in the global namespace. */ savedVarFramePtr = iPtr->varFramePtr; - if (flags & TCL_EVAL_INVOKE) { + if (flags & (TCL_EVAL_INVOKE | TCL_EVAL_GLOBAL)) { iPtr->varFramePtr = NULL; } cmdPtr = (Command *) Tcl_GetCommandFromObj(interp, objv[0]); @@ -3667,8 +3671,8 @@ Tcl_EvalEx(interp, script, numBytes, flags) code = TCL_ERROR; } else { iPtr->numLevels++; - code = TclEvalObjvInternal(interp, objectsUsed, objv, p, - parse.commandStart + parse.commandSize - p, 0); + code = TclEvalObjvInternal(interp, objectsUsed, objv, + parse.commandStart, parse.commandSize, 0); iPtr->numLevels--; } if (code != TCL_OK) { |