Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 94c3d7c33c6f0531a2248f68a2e5224d5e2323d4
Ticket: 577033ffffffffffffffffffffffffffffffffff
tcl_findLibrary sets 'varName' on fail
User & Date: vincentdarley on 2002-07-03 16:07:02
Changes

  1. assignee changed to: "dgp"
  2. cmimetype changed to: "text/plain"
  3. 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.
    
    
  4. foundin changed to: "obsolete: 8.4a5"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "vincentdarley"
  9. subsystem changed to: "38. Init - Library - Autoload"
  10. title changed to: "tcl_findLibrary sets 'varName' on fail"
  11. type changed to: "Bug"