summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2003-04-25 21:23:06 (GMT)
committerdgp <dgp@users.sourceforge.net>2003-04-25 21:23:06 (GMT)
commit044b2f3286bfc5afce188db48744bc1512a55cea (patch)
tree8dbab0b2e2b5b22cbdafa388ab48886a5cefb66c /generic
parent543aeb83fcc4b4038df038a196d851c76f2cc5bf (diff)
downloadtcl-044b2f3286bfc5afce188db48744bc1512a55cea.zip
tcl-044b2f3286bfc5afce188db48744bc1512a55cea.tar.gz
tcl-044b2f3286bfc5afce188db48744bc1512a55cea.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().
Diffstat (limited to 'generic')
-rw-r--r--generic/tclBasic.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index c7c990d..021b937 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.78 2003/04/05 01:41:22 dkf Exp $
+ * RCS: @(#) $Id: tclBasic.c,v 1.79 2003/04/25 21:23:18 dgp Exp $
*/
#include "tclInt.h"
@@ -3004,10 +3004,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]);
@@ -3515,8 +3519,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) {