diff options
author | dgp <dgp@users.sourceforge.net> | 2014-11-03 21:37:37 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2014-11-03 21:37:37 (GMT) |
commit | 77d8108158b1e45e8dc31209eccbe00787a73fb2 (patch) | |
tree | 4ba027b0e631be2056005881c5fea53bad2eadb0 /generic/tclIORTrans.c | |
parent | 7903c310683834f01564dde909b82e008ea07947 (diff) | |
download | tcl-77d8108158b1e45e8dc31209eccbe00787a73fb2.zip tcl-77d8108158b1e45e8dc31209eccbe00787a73fb2.tar.gz tcl-77d8108158b1e45e8dc31209eccbe00787a73fb2.tar.bz2 |
Make sure reflected channels do not make a double call to Tcl_ReadRaw(),
with the unwarranted assumption that EOF is a permanent condition.
Diffstat (limited to 'generic/tclIORTrans.c')
-rw-r--r-- | generic/tclIORTrans.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/generic/tclIORTrans.c b/generic/tclIORTrans.c index 45ee08d..8f3ef3c 100644 --- a/generic/tclIORTrans.c +++ b/generic/tclIORTrans.c @@ -1097,6 +1097,11 @@ ReflectInput( goto stop; } + if (rtPtr->readIsDrained) { + goto stop; + } + + /* * The buffer is exhausted, but the caller wants even more. We now * have to go to the underlying channel, get more bytes and then @@ -1166,10 +1171,6 @@ ReflectInput( * on the down channel. */ - if (rtPtr->readIsDrained) { - goto stop; - } - /* * Now this is a bit different. The partial data waiting is * converted and returned. |