summaryrefslogtreecommitdiffstats
path: root/generic/tclIOUtil.c
diff options
context:
space:
mode:
authorhobbs <hobbs>2000-05-27 23:58:00 (GMT)
committerhobbs <hobbs>2000-05-27 23:58:00 (GMT)
commit15694426fe8aee1201ebb7357f86aafb07fad4fd (patch)
treeb275275ca134079f193ad0b79e15e00afb8b0aee /generic/tclIOUtil.c
parentf57fe67295145c6b28d1f4e3536eb0408a0fd410 (diff)
downloadtcl-15694426fe8aee1201ebb7357f86aafb07fad4fd.zip
tcl-15694426fe8aee1201ebb7357f86aafb07fad4fd.tar.gz
tcl-15694426fe8aee1201ebb7357f86aafb07fad4fd.tar.bz2
* tests/info.test:
* doc/info.n: * generic/tclIOUtil.c (Tcl_EvalFile): * generic/tclCmdIL.c (InfoScriptCmd): added ability to set the info script return value [info script ?newFileName?]. This will be beneficial for virtual file system programs. [Bug: 4225]
Diffstat (limited to 'generic/tclIOUtil.c')
-rw-r--r--generic/tclIOUtil.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c
index 41db745..f4412e5 100644
--- a/generic/tclIOUtil.c
+++ b/generic/tclIOUtil.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: tclIOUtil.c,v 1.10 2000/05/11 00:16:53 hobbs Exp $
+ * RCS: @(#) $Id: tclIOUtil.c,v 1.11 2000/05/27 23:58:01 hobbs Exp $
*/
#include "tclInt.h"
@@ -324,9 +324,11 @@ Tcl_EvalFile(interp, fileName)
iPtr = (Interp *) interp;
oldScriptFile = iPtr->scriptFile;
- iPtr->scriptFile = fileName;
+ iPtr->scriptFile = ckalloc((unsigned) (strlen(fileName) + 1));
+ strcpy(iPtr->scriptFile, fileName);
string = Tcl_GetStringFromObj(objPtr, &length);
result = Tcl_EvalEx(interp, string, length, 0);
+ ckfree(iPtr->scriptFile);
iPtr->scriptFile = oldScriptFile;
if (result == TCL_RETURN) {