Tcl Source Code

View Ticket
Login
Ticket UUID: 6de8494984e49b052d3ad82b8cd7e900b67274b3
Title: Tcl_CreateCommandChannel() documentation bug
Type: Bug Created on: 2019-08-14 13:18:01
Submitter: ralfixx Assigned to: jan.nijtmans
Subsystem: 24. Channel Commands Severity: Minor
Priority: 5 Medium Last modified: 2019-08-15 08:10:37
Status: Closed Closed by: jan.nijtmans
Resolution: Fixed Closed on: 2019-08-15 08:10:37
Version: 8.6.9
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!