Tcl Library Source Code

Ticket Change Details
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.
Overview

Artifact ID: 2f3f6a88532db43f16a182860abfa30051b01c013a5644dbf873756e7eb1a51a
Ticket: 1975182bddc84f6601f60b0acf2f326eae10316f
tcl::chan::cat - syntax error and bad behavior with fileevents
User & Date: anonymous 2019-03-12 23:15:43
Changes

  1. Change assignee to "nobody"
  2. Change closer to "nobody"
  3. Change cmimetype to "text/plain"
  4. Change comment to:
    tcl::cache::cat 1.0.3 has a critical bug, if an event handler has been registered on the reflected channel. 
    
    By running the following code (interactively from wish)
    
    -----------------------------
    package tcl::chan::chan
    package tcl::chan::string
    
      # setup 2 simple data-channels.
      #  Here we use two simple string-channels but we could also [open] two simple files. 
    set fd1 [tcl::chan::string "ABCDE..XYZ"]
    set fd2 [tcl::chan::string "0123456789"]
     # setup a cat'enated channel
    set ch [tcl::chan::cat $fd1 $fd2]
    
     # register a file handler printing the contents of the cat'enated channel
     #  by reading 4 bytes at time -- NOTE: ch is a global variable
    # expected result is
    # <<ABCD>>
    # <<E..X>>
    # <<YZ01>>
    # <<2345>>
    # <<6789>>
    # <<>>
    chan event $ch readable {
        if { [eof $ch] } { close $ch } else { puts "<<[read $ch 4]>>" }
    }
    
    # ! NOTHING happens !!!!
    
     # trying to force a read ...
    read $ch 1 ;#  -->  error ... see below
    --------------------------------------------
    bad event name "rc7": must be readable or writable
    --------------------------------------------
    
    There's an error in the logic of the "watch" method.
    
    I included a zip with all the updated files; corrections and some code cleaning.
    - cat.tcl       --  the main correction, and version changed to 1.0.3
    - pkgIndex.tcl  --  version changed 
    - cat.man       --  version changed
    - changeLog     --  version changed
    
    ABU
    
  5. Change foundin to "1.19"
  6. Change is_private to "0"
  7. Change login to "anonymous"
  8. Change priority to "5 Medium"
  9. Change private_contact to "af9c70d5700d5af288b87a3a9ed94e1300911d18"
  10. Change resolution to "None"
  11. Change severity to "Critical"
  12. Change status to "Open"
  13. Change submitter to "anonymous"
  14. Change subsystem to "tcl :: chan :: *"
  15. Change title to:
    tcl::chan::cat - syntax error and bad behavior with fileevents
    
  16. Change type to "Bug"