Tcl Source Code

View Ticket
Login
Ticket UUID: 6de8494984e49b052d3ad82b8cd7e900b67274b3
Title: Tcl_CreateCommandChannel() documentation bug
Type: Bug Version: 8.6.9
Submitter: ralfixx Created on: 2019-08-14 13:18:01
Subsystem: 24. Channel Commands Assigned To: jan.nijtmans
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2019-08-15 08:10:37
Resolution: Fixed Closed By: jan.nijtmans
    Closed on: 2019-08-15 08:10:37
Description:

https://www.tcl.tk/man/tcl/TclLib/OpenFileChnl.htm#M7 states for Tcl_OpenCommandChannel():

  If an error occurs while opening the channel, [...] In addition, 
  Tcl_OpenCommandChannel leaves an error message in the interpreter's
  result if interp is not NULL. 

The code in generic/TclPipe.c however states that interp cannot be NULL:

  Tcl_Channel
  Tcl_OpenCommandChannel(
      Tcl_Interp *interp, /* Interpreter for error reporting. Can NOT be NULL. */

And indeed, calling Tcl_OpenCommandChannel(NULL, ...) dumps core in case of an error when opening the pipeline (e.g. command not found).

=> Documentation should be adjusted: "interp cannot be NULL".

User Comments: jan.nijtmans added on 2019-08-15 08:10:37:
Fixed now in all active branches.

Thanks!