Tcl Library Source Code

Ticket Change Details
Login
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. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/plain"
  4. comment changed 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. foundin changed to: "1.19"
  6. is_private changed to: "0"
  7. login: "anonymous"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "af9c70d5700d5af288b87a3a9ed94e1300911d18"
  10. resolution changed to: "None"
  11. severity changed to: "Critical"
  12. status changed to: "Open"
  13. submitter changed to: "anonymous"
  14. subsystem changed to: "tcl :: chan :: *"
  15. title changed to:
    tcl::chan::cat - syntax error and bad behavior with fileevents
    
  16. type changed to: "Bug"