Overview
| Artifact ID: | 94c3d7c33c6f0531a2248f68a2e5224d5e2323d4 |
|---|---|
| Ticket: | 577033ffffffffffffffffffffffffffffffffff
tcl_findLibrary sets 'varName' on fail |
| User & Date: | vincentdarley on 2002-07-03 16:07:02 |
Changes
- assignee changed to: "dgp"
- cmimetype changed to: "text/plain"
- comment changed to:
Basic problem: tcl_findLibrary is supposed to set the variable $varName to the directory containing a specific file, if that file is successfully found and sourced. However, if the procedure is unable to find the file, it still sets $varName to the last location that was looked at. This can have unfortunate side effects... Example of the problem: If any extension wants to call tcl_findLibrary twice (because, perhaps for legacy reasons, the pkg.tcl file it is looking for could be in two different places), then between the two calls, a 'Tcl_UnsetVar (..., "myPkgVar", TCL_GLOBAL_ONLY) is required. Otherwise the first call to tcl_findLibrary (which we will assume fails) leaves myPkgVar set to the last directory that was looked at, and then the second call to tcl_findLibrary will only examine that location. Suggested solution: Either this constraint should be documented or tcl_findLibrary should be fixed so that if '$varName' doesn't exist when it is called, then if the procedure fails, '$varName' should also not exist when the procedure returns.
- foundin changed to: "obsolete: 8.4a5"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "vincentdarley"
- subsystem changed to: "38. Init - Library - Autoload"
- title changed to: "tcl_findLibrary sets 'varName' on fail"
- type changed to: "Bug"