Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: f3751f34e49939e215bcd6bc592b15185104c542
Ticket: 940281ffffffffffffffffffffffffffffffffff
Tcl_FSJoinPath not as documented
User & Date: dgp on 2004-04-22 20:04:58
Changes

  1. assignee changed to: "vincentdarley"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    
    Docs claim that Tcl_FSJoinPath returns
    a (Tcl_Obj *) -- the joined path.  However,
    it sometimes returns NULL instead.
    
    Notably, it returns NULL if an invalid list
    is passed in as the listObj argument.
    That makes some sense, though a
    Tcl_Panic() might be just a suitable.
    The caller is simply broken.  Either
    way that should be documented.
    
    The more serious problem is when
    listObj is a valid list, but a value of
    0 is passed as the elements argument.
    Then NULL is returned instead of an
    empty string path.  This  breaks
    simple uses like:
    
     elements = Tcl_FSSplitPath(path, &count);
     Tcl_IncrRefCount(elements);
     parent = Tcl_FSJoinPath(elements, count -1);
     Tcl_IncrRefCount(parent);       /* possible CRASH! */
     Tcl_ListObjIndex(NULL, elements, count - 1, &tail);
     Tcl_IncrRefCount(tail);
     Tcl_DecrRefCount(elements);
    
    
    
  4. foundin changed to: "obsolete: 8.5a2"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "dgp"
  9. subsystem changed to: "37. File System"
  10. title changed to: "Tcl_FSJoinPath not as documented"
  11. type changed to: "Bug"