summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--generic/tclEnsemble.c2
-rw-r--r--generic/tclIOUtil.c13
3 files changed, 14 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 05631c6..04a4343 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2012-04-15 Donal K. Fellows <dkf@users.sf.net>
+ * generic/tclEnsemble.c (NsEnsembleImplementationCmdNR):
+ * generic/tclIOUtil.c (Tcl_FSEvalFileEx): Cut out levels of the C
+ stack by going direct to the relevant internal evaluation function.
+
* generic/tclZlib.c (ZlibTransformSetOption): [Bug 3517696]: Make
flushing work correctly in a pushed compressing channel transform.
diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c
index f33ad31..1e1a901 100644
--- a/generic/tclEnsemble.c
+++ b/generic/tclEnsemble.c
@@ -1849,7 +1849,7 @@ NsEnsembleImplementationCmdNR(
*/
iPtr->evalFlags |= TCL_EVAL_REDIRECT;
- return Tcl_NREvalObj(interp, copyPtr, TCL_EVAL_INVOKE);
+ return TclNREvalObjEx(interp, copyPtr, TCL_EVAL_INVOKE, NULL,INT_MIN);
}
unknownOrAmbiguousSubcommand:
diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c
index 9905256..3c98128 100644
--- a/generic/tclIOUtil.c
+++ b/generic/tclIOUtil.c
@@ -1729,9 +1729,12 @@ Tcl_FSEvalFileEx(
objPtr = Tcl_NewObj();
Tcl_IncrRefCount(objPtr);
- /* Try to read first character of stream, so we can
- * check for utf-8 BOM to be handled especially.
+
+ /*
+ * Try to read first character of stream, so we can check for utf-8 BOM to
+ * be handled especially.
*/
+
if (Tcl_ReadChars(chan, objPtr, 1, 0) < 0) {
Tcl_Close(interp, chan);
Tcl_AppendResult(interp, "couldn't read file \"",
@@ -1739,10 +1742,12 @@ Tcl_FSEvalFileEx(
goto end;
}
string = Tcl_GetString(objPtr);
+
/*
* If first character is not a BOM, append the remaining characters,
- * otherwise replace them [Bug 3466099].
+ * otherwise replace them. [Bug 3466099]
*/
+
if (Tcl_ReadChars(chan, objPtr, -1,
memcmp(string, "\xef\xbb\xbf", 3)) < 0) {
Tcl_Close(interp, chan);
@@ -1766,7 +1771,7 @@ Tcl_FSEvalFileEx(
*/
iPtr->evalFlags |= TCL_EVAL_FILE;
- result = Tcl_EvalEx(interp, string, length, 0);
+ result = TclEvalEx(interp, string, length, 0, 1, NULL, string);
/*
* Now we have to be careful; the script may have changed the