summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--generic/tclBasic.c12
2 files changed, 15 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 4461127..4e9c664 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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) {