Menu

#3049 Tcl_OpenFileChannel doesn't say that argv must end in NULL

obsolete: 8.4.9
closed-fixed
7
2005-10-05
2005-01-25
No

The comments for

int
TclCreatePipeline(interp, argc, argv, pidArrayPtr,
inPipePtr,
outPipePtr, errFilePtr)

say that:

CONST char **argv; /* Array of strings describing
commands in
* pipeline plus I/O redirection with <,
* <<, >, etc. Argv[argc] must be NULL. */

But the documentation for Tcl_OpenFileChannel makes no
mention of this! Either the documentation should be
changed, or the command should dispense with the final
NULL requirement (it has an argc, so why does it need a
final NULL, too?).

Discussion

  • Andreas Kupries

    Andreas Kupries - 2005-01-25

    Logged In: YES
    user_id=75003

    Note: David had a mem corruption issue and crash because of
    this. The easy fix, updating the docs, might not be the
    right fix.

    This needs a deeper look.

     
  • Andreas Kupries

    Andreas Kupries - 2005-01-25
    • priority: 5 --> 7
     
  • David N. Welton

    David N. Welton - 2005-01-25
     
  • David N. Welton

    David N. Welton - 2005-01-25

    Logged In: YES
    user_id=240

    I whipped up the following patch, which eliminates the
    requirement for argv[argc] to exist and be NULL. It works
    for me, and seems to pass the relevant tests. I've got a
    nasty case of the flu, so my addled brain may have missed
    something:-)

     
  • Don Porter

    Don Porter - 2005-01-26

    Logged In: YES
    user_id=80530

    Note that pre-patch, the
    TclCreatePipeline routine
    ignores the value of its
    argc argument. Note also
    the comment that the
    routine is directly called
    by BLT. Would be wise to
    check whether BLT relies on
    the argc value getting ignored.

     
  • David N. Welton

    David N. Welton - 2005-01-27

    Logged In: YES
    user_id=240

    I couldn't find TclCreatePipeline in the version of BLT that
    ships with Debian: 2.4z

     
  • Donal K. Fellows

    • milestone: --> obsolete: 8.4.9
     
  • Donal K. Fellows

    Logged In: YES
    user_id=79902

    OK, in that case (BLT no longer using it) just fix it so
    that argv[argc] is never referred to.

     
  • Andreas Kupries

    Andreas Kupries - 2005-10-05
    • status: open --> closed-fixed
     
  • Andreas Kupries

    Andreas Kupries - 2005-10-05

    Logged In: YES
    user_id=75003

    Accepted the patch and applied to both 8.4 and cvs head.