summaryrefslogtreecommitdiffstats
path: root/generic/tclIOGT.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2014-10-28 20:10:32 (GMT)
committerdgp <dgp@users.sourceforge.net>2014-10-28 20:10:32 (GMT)
commit7ab8a9b2efc85997d0a6f576c20a69d272bd98ff (patch)
treef028b842e93ec6e43d37de0ddf424781dd34940d /generic/tclIOGT.c
parentf015a62dd6b90d27db2849f96b3a9af050a291dc (diff)
downloadtcl-7ab8a9b2efc85997d0a6f576c20a69d272bd98ff.zip
tcl-7ab8a9b2efc85997d0a6f576c20a69d272bd98ff.tar.gz
tcl-7ab8a9b2efc85997d0a6f576c20a69d272bd98ff.tar.bz2
Work in progress restoring ability to [read] after [eof] and get non-empty
strings back in those cases where the channel has them to offer. Also working through all the implications of this possibility on Tcl's more exotic channel features, like stacking.
Diffstat (limited to 'generic/tclIOGT.c')
-rw-r--r--generic/tclIOGT.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/generic/tclIOGT.c b/generic/tclIOGT.c
index fe0a880..a78a5b4 100644
--- a/generic/tclIOGT.c
+++ b/generic/tclIOGT.c
@@ -677,6 +677,18 @@ TransformInputProc(
break;
}
+ if (dataPtr->readIsFlushed) {
+ /*
+ * Already saw EOF from downChan; don't ask again.
+ * NOTE: Could move this up to avoid the last maxRead
+ * execution. Believe this would still be correct behavior,
+ * but the test suite tests the whole command callback
+ * sequence, so leave it unchanged for now.
+ */
+
+ break;
+ }
+
/*
* Get bytes from the underlying channel.
*/
@@ -712,14 +724,6 @@ TransformInputProc(
* on the down channel.
*/
- if (dataPtr->readIsFlushed) {
- /*
- * Already flushed, nothing to do anymore.
- */
-
- break;
- }
-
dataPtr->readIsFlushed = 1;
ExecuteCallback(dataPtr, NULL, A_FLUSH_READ, NULL, 0,
TRANSMIT_IBUF, P_PRESERVE);