summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvincentdarley <vincentdarley>2003-02-18 10:13:25 (GMT)
committervincentdarley <vincentdarley>2003-02-18 10:13:25 (GMT)
commit2b8975d8a5d0bdd34a74b2a375fd2945df3cb6e7 (patch)
treee6b977bb7db88dfbe6c9f9c4eafe194e3be42bc9
parentf8216e07a1d1364967afd2f56628b355401e46cb (diff)
downloadtcl-2b8975d8a5d0bdd34a74b2a375fd2945df3cb6e7.zip
tcl-2b8975d8a5d0bdd34a74b2a375fd2945df3cb6e7.tar.gz
tcl-2b8975d8a5d0bdd34a74b2a375fd2945df3cb6e7.tar.bz2
cleanup of new simplefs test code
-rw-r--r--ChangeLog5
-rw-r--r--generic/tclTest.c16
2 files changed, 15 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index cc8dd2d..ac2f0f3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2003-02-18 Vince Darley <vincentdarley@users.sourceforge.net>
+
+ * generic/tclTest.c: cleanup of new 'simplefs' test code, and
+ better documentation.
+
2003-02-17 Miguel Sofer <msofer@users.sf.net>
* generic/tclBasic.c (TclRenameCommand): fixing error in previous
diff --git a/generic/tclTest.c b/generic/tclTest.c
index fe84173..ed7e0ad 100644
--- a/generic/tclTest.c
+++ b/generic/tclTest.c
@@ -14,7 +14,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclTest.c,v 1.61 2003/02/15 20:24:10 kennykb Exp $
+ * RCS: @(#) $Id: tclTest.c,v 1.62 2003/02/18 10:13:25 vincentdarley Exp $
*/
#define TCL_TEST
@@ -6263,15 +6263,15 @@ static Tcl_Interp *simpleInterpPtr = NULL;
static Tcl_Obj *tempFile = NULL;
/*
- * This is a very 'hacky' filesystem which is used just so
+ * This is a very 'hacky' filesystem which is used just to
* test two important features of the vfs code: (1) that
* you can load a shared library from a vfs, (2) that when
* copying files from one fs to another, the 'mtime' is
* preserved.
*
- * It reates any file in 'simplefs:/' as a real file, and
+ * It treats any file in 'simplefs:/' as a file, and
* artificially creates a real file on the fly which it uses
- * to extract information from. The real file is uses is
+ * to extract information from. The real file it uses is
* whatever follows the trailing '/' (e.g. 'foo' in 'simplefs:/foo'),
* and that file is assumed to exist in the native pwd, and is
* copied over to the native temporary directory where it is
@@ -6379,13 +6379,17 @@ SimpleOpenFileChannel(interp, pathPtr, mode, permissions)
}
chan = Tcl_FSOpenFileChannel(interp, tempPtr, "r", permissions);
- /* When we are done with this file, it will never be deleted */
+
if (tempFile != NULL) {
Tcl_FSDeleteFile(tempFile);
Tcl_DecrRefCount(tempFile);
+ tempFile = NULL;
}
+ /*
+ * Store file pointer in this global variable so we can delete
+ * it later
+ */
tempFile = tempPtr;
-
return chan;
}