summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorandreas_kupries <akupries@shaw.ca>2008-04-15 18:34:47 (GMT)
committerandreas_kupries <akupries@shaw.ca>2008-04-15 18:34:47 (GMT)
commit792972c9a4f2ab1f7a38cc284392f8df4b8301dd (patch)
tree3b59fce365b858e6d35af4ad8c484f737a7030fe /generic
parent8c81a86813da48f3a4d88fd1543b559e9d691ec5 (diff)
downloadtcl-792972c9a4f2ab1f7a38cc284392f8df4b8301dd.zip
tcl-792972c9a4f2ab1f7a38cc284392f8df4b8301dd.tar.gz
tcl-792972c9a4f2ab1f7a38cc284392f8df4b8301dd.tar.bz2
* generic/tclIO.c (CopyData): Applied another patch by Alexandre
* io.test (io-53.8a): Ferrieux <ferrieux@users.sourceforge.net>, * chanio.test (chan-io-53.8a): to shift EOF handling to the async part of the command if a callback is specified, should the channel be at EOF already when fcopy is called. Testcase by myself.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclIO.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c
index 2b6138c..1d917ba 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclIO.c,v 1.141 2008/04/07 22:53:08 andreas_kupries Exp $
+ * RCS: @(#) $Id: tclIO.c,v 1.142 2008/04/15 18:34:47 andreas_kupries Exp $
*/
#include "tclInt.h"
@@ -8641,15 +8641,17 @@ CopyData(
break;
} else if (underflow) {
/*
- * We had an underflow on the read side. If we are at EOF, then
- * the copying is done, otherwise set up a channel handler to
- * detect when the channel becomes readable again.
+ * We had an underflow on the read side. If we are at EOF, and not
+ * in the synchronous part of an asynchronous fcopy, then the
+ * copying is done, otherwise set up a channel handler to detect
+ * when the channel becomes readable again.
*/
- if ((size == 0) && Tcl_Eof(inChan)) {
+ if ((size == 0) && Tcl_Eof(inChan) && !(cmdPtr && (mask == 0))) {
break;
}
- if (! Tcl_Eof(inChan) && !(mask & TCL_READABLE)) {
+ if (((!Tcl_Eof(inChan)) || (cmdPtr && (mask == 0))) &&
+ !(mask & TCL_READABLE)) {
if (mask & TCL_WRITABLE) {
Tcl_DeleteChannelHandler(outChan, CopyEventProc, csPtr);
}