Menu

#14 Fix for coping with 0 from Tcl_ReadChars()

None
closed-fixed
nobody
None
5
2018-04-27
2011-10-12
Anonymous
No

Tcl_ReadChars() is a nonblocking function and may return 0 even if select(2)
indicated some data was available. Cope with this by explicitly checking for
EOF if Tcl_ReadChars() returned 0.

Interestingly, this makes the comment immediately preceding the test accurate
once more.

To trigger the failure this patch fixes easily, run with a multi-byte locale (e.g.
en_GB.UTF-8) and over a pty/serial port/etc., send a single octet of a valid
multi-byte character (e.g. 0xE0).

Whilst I generated this patch against 5.44.1.15 it applies fine against 5.45 and
a visual inspection shows all is well.

Discussion

  • Nils Carlson

    Nils Carlson - 2018-04-27

    Closing, should already be fixed by now.

     
  • Nils Carlson

    Nils Carlson - 2018-04-27
    • status: open --> closed-fixed
    • Group: -->
     

Log in to post a comment.