Skip to content
Tcl Source Code View Ticket
Login

View Ticket

Tcl_Init fails if Tcl_FindExecutable wasn't called

Closed / Fixed218135ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 00:53:35
OriginalBugID: 2052 Bug
Version: 8.1
SubmitDate: '1999-05-12'
LastModified: '1999-09-15'
Severity: MED
Status: Closed
Submitter: pat
ChangedBy: hobbs
OS: SunOS
OSVersion: 5.6
Machine: Sparc
FixedDate: '2000-10-25'
ClosedDate: '1999-09-15'


Name:
Prasad A. Chodavarapu

CustomShell:
--threads-enabled

ReproducibleScript:
#include <tcl.h>
    #include <iostream.h>
    #include <assert.h>
    
    int main(int argc, char* argv[]) {
      Tcl_Interp* _interp = Tcl_CreateInterp();
      assert(_interp);
      //Tcl_FindExecutable(argv[0]);//upto and incl. 8.1b2, tcl didn't need
    this
      if (Tcl_Init(_interp) == TCL_ERROR) {
        cerr << Tcl_GetStringFromObj(Tcl_GetObjResult(_interp),NULL) <<
    endl;
        return -1;
      }
      return 0;
    }

ObservedBehavior:
Upto and incl. tcl8.1b2, we didn't need to necessarily call
    Tcl_FindExecutable(argv[0]) before calling Tcl_FindExecutable(argv[0])
    In tcl8.1 final release, Tcl_Init fails saying it cannot find init.tcl
    in the directory list {empty} even though TCL_LIBRARY environment
    variable is 
    correctly set to the directory where init.tcl resides.
    
    basically, Tcl_Init is ignoring the value of TCL_LIBRARY unless
    Tcl_FindExecutable(argv[0]) has been called. This is undesirable and not
    backwards incompatible.

DesiredBehavior:
As in previous versions, if TCL_LIBRARY is set, we shouldn't need to
    call Tcl_FindExecutable(argv[0]) before calling Tcl_Init(_interp)



This change was made because without it, problems with encoding
could occur.  While not well doc'ed this isn't a bug.  We are
looking into maybe improving this for 8.3. 
-- 09/15/1999 hobbs
welch Closed ticket [218135ffff]. [History diff]2000-10-26 08:15:55
dgp Ticket [218135ffff]: 3 changes [History diff]2001-04-18 06:25:18
Log in (anonymous is fine) to add a comment.