From: Vince D. <vi...@sa...> - 2005-08-21 22:32:59
|
It's not really documented what Tcl_FSMatchInDirectory is supposed to do with a null interp, and I notice that the windows filesystem assumes the interp is ok. So this is likely a bug in both documentation and code (we should do the standard thing of simply not providing an error message if no interp is provided). Also, as you note, a bug in tclvfs. Please do report bugs against both tcl and tclvfs. -- Vince On Sun, 21 Aug 2005, David N. Welton wrote: > Hello, > > I'm doing some hacking on tclkit for a customer, and I bumped into > something untoward behavior. I'm trying to determine who is at fault, > but I have an idea it's VFS. I didn't see any vfs specific lists, so I > thought I'd post here. > > #0 Tcl_SetObjResult (interp=0x0, objPtr=0x815e068) > at ../../../src/tcl/generic/tclResult.c:513 > #1 0x080f244a in VfsMatchInDirectory () > #2 0x080a7daf in Tcl_FSMatchInDirectory (interp=0x0, resultPtr=0x815de88, > pathPtr=0x815e290, pattern=0x810321c "*.enc", types=0xbfffed70) > at ../../../src/tcl/generic/tclIOUtil.c:1051 > #3 0x08082d74 in MakeFileMap () at > ../../../src/tcl/generic/tclEncoding.c:405 > #4 0x08082ebc in FillEncodingFileMap () > at ../../../src/tcl/generic/tclEncoding.c:448 > #5 0x08082bd6 in TclSetEncodingSearchPath (searchPath=0x815e518) > at ../../../src/tcl/generic/tclEncoding.c:305 > #6 0x08056238 in LibraryPathObjCmd () > > THe problem seems to be that MakeFileMap calls Tcl_FSMatchInDirectory > with interp set to NULL. That in turn calls VfsMatchInDirectory with > interp which is of course still NULL. Towards the end of that function > lurks the following code: > > if (vfsResultPtr != NULL) { > if (returnVal == TCL_OK) { > Tcl_IncrRefCount(vfsResultPtr); > Tcl_ListObjAppendList(cmdInterp, returnPtr, vfsResultPtr); > Tcl_DecrRefCount(vfsResultPtr); > } else { > Tcl_SetObjResult(cmdInterp, vfsResultPtr); > } > } > return returnVal; > } > > So it would appear that if there is an error, it attempts to set the > result of a NULL interpreter, which makes Tcl grumpy. > > -- > David N. Welton > - http://www.dedasys.com/davidw/ > > Apache, Linux, Tcl Consulting > - http://www.dedasys.com/ > > > ------------------------------------------------------- > SF.Net email is Sponsored by the Better Software Conference & EXPO > September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices > Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA > Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf > _______________________________________________ > Tcl-Core mailing list > Tcl...@li... > https://lists.sourceforge.net/lists/listinfo/tcl-core > |