Skip to content
Tcl Source Code View Ticket
Login

View Ticket

Tcl_CreateCommandChannel() documentation bug

Closed / Fixed6de8494984e49b052d3ad82b8cd7e900b67274b3Created 7 years agoUpdated 7 years ago
Descriptionwiki2019-08-14 13:18:01
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".

Referenced by1
jan.nijtmansplain2019-08-15 08:10:37
Fixed now in all active branches.

Thanks!
Log in (anonymous is fine) to add a comment.