Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2019-08-15
08:10 • Closed ticket [6de8494984]: Tcl_CreateCommandChannel() documentation bug plu... artifact: 4814315893 user: jan.nijtmans
07:04
Fix [6de8494984]: Tcl_CreateCommandChannel() documentation bug check-in: 2357da0c1e user: jan.nijtmans tags: core-8-6-branch
2019-08-14
13:18 • New ticket [6de8494984] Tcl_CreateCommandChannel() documentation bug. artifact: 11203e8a83 user: ralfixx

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.