diff options
author | vincentdarley <vincentdarley@noemail.net> | 2003-02-18 10:13:25 (GMT) |
---|---|---|
committer | vincentdarley <vincentdarley@noemail.net> | 2003-02-18 10:13:25 (GMT) |
commit | 6ffb39987f0f800d57f1f5cb1db3719be808aad2 (patch) | |
tree | e6b977bb7db88dfbe6c9f9c4eafe194e3be42bc9 /generic | |
parent | de55b909ac9221a9ae0415dd3b70cde88a6aa348 (diff) | |
download | tcl-6ffb39987f0f800d57f1f5cb1db3719be808aad2.zip tcl-6ffb39987f0f800d57f1f5cb1db3719be808aad2.tar.gz tcl-6ffb39987f0f800d57f1f5cb1db3719be808aad2.tar.bz2 |
cleanup of new simplefs test code
FossilOrigin-Name: 67cfbfbc4130fe515bb77de2bef800761e917236
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclTest.c | 16 |
1 files changed, 10 insertions, 6 deletions
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; } |