Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: e69d007028d130c082bee7c276376d63d3c24eab
Ticket: 219057ffffffffffffffffffffffffffffffffff
info script should take an option parameter so you can set t
User & Date: nobody on 2000-10-26 01:09:59
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 4225 RFE
    Version: 8.3
    SubmitDate: '2000-02-22'
    LastModified: '2000-05-27'
    Severity: SER
    Status: Released
    Submitter: welch
    ChangedBy: hobbs
    OS: All
    FixedDate: '2000-05-27'
    FixedInVersion: 8.4a1
    ClosedDate: '2000-10-25'
    
    
    Anyone that overrides the "source" command has a problem with
    
    info script - it won't return the correct value.  By allowing an
    
    optional parameter to info script that sets the current script value,
    
    then a proper hooking of source can be achieved.  Otherwise you have
    
    to redefine the whole info command, which can slow down your whole
    
    application miserably.
    
    
    
    Patch:
    
    
    
    Index: generic/tclCmdIL.c
    
    ===================================================================
    
    RCS file: /home/cvs/external/tcl/generic/tclCmdIL.c,v
    
    retrieving revision 1.26
    
    diff -r1.26 tclCmdIL.c
    
    1581c1581,1583
    
    <  *          info script
    
    ---
    
    >  *          info script ?newName?
    
    >  *
    
    >  *If newName is specified, it will set that as the internal name.
    
    1588c1590,1591
    
    <  *an error, the result is an error message.
    
    ---
    
    >  *an error, the result is an error message.  It may change the
    
    >  *internal script filename.
    
    1601c1604
    
    <     if (objc != 2) {
    
    ---
    
    >     if ((objc != 2) && (objc != 3)) {
    
    1605a1609,1618
    
    >     if (objc == 3) {
    
    > int length;
    
    > char *filename = Tcl_GetStringFromObj(objv[2], &length);
    
    > 
    
    > if (iPtr->scriptFile != NULL) {
    
    >     ckfree(iPtr->scriptFile);
    
    > }
    
    > iPtr->scriptFile = ckalloc((unsigned) (length + 1));
    
    > strcpy(iPtr->scriptFile, filename);
    
    >     }
    
    Index: generic/tclIOUtil.c
    
    ===================================================================
    
    RCS file: /home/cvs/external/tcl/generic/tclIOUtil.c,v
    
    retrieving revision 1.10
    
    diff -r1.10 tclIOUtil.c
    
    327c327,328
    
    <     iPtr->scriptFile = fileName;
    
    ---
    
    >     iPtr->scriptFile = ckalloc((unsigned) (strlen(fileName) + 1));
    
    >     strcpy(iPtr->scriptFile, fileName);
    
    329a331
    
    >     ckfree(iPtr->scriptFile);
    
    
    
    Patched as above for 8.4a1. 
    -- 05/27/2000 hobbs
    
  4. foundin changed to: "obsolete: 8.3"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "81. Bundled Packages"
  10. title changed to:
    info script should take an option parameter so you can set t
    
  11. type changed to: "RFE"