diff options
author | andreas_kupries <andreas_kupries@noemail.net> | 2008-04-15 18:31:00 (GMT) |
---|---|---|
committer | andreas_kupries <andreas_kupries@noemail.net> | 2008-04-15 18:31:00 (GMT) |
commit | 5baa8fd49dbe56dfd0b6e71a1f419ffc68b7bdb1 (patch) | |
tree | 47b7f0cb5e199796391f1815fe3338f47f492d86 /generic/tclIO.c | |
parent | 9d298b9a2a12568abe7b22c3d746d0a5db65ca3c (diff) | |
download | tcl-5baa8fd49dbe56dfd0b6e71a1f419ffc68b7bdb1.zip tcl-5baa8fd49dbe56dfd0b6e71a1f419ffc68b7bdb1.tar.gz tcl-5baa8fd49dbe56dfd0b6e71a1f419ffc68b7bdb1.tar.bz2 |
* generic/tclIO.c (CopyData): Applied another patch by Alexandre
* io.test (io-53.8a): Ferrieux <ferrieux@users.sourceforge.net>,
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.
FossilOrigin-Name: ca26b071d8c925b2cf8984e69526de5cd7365d7b
Diffstat (limited to 'generic/tclIO.c')
-rw-r--r-- | generic/tclIO.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c index 3f79021..6502215 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.61.2.27 2008/04/07 22:17:37 andreas_kupries Exp $ + * RCS: @(#) $Id: tclIO.c,v 1.61.2.28 2008/04/15 18:31:01 andreas_kupries Exp $ */ #include "tclInt.h" @@ -7887,15 +7887,18 @@ CopyData(csPtr, mask) 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, (ClientData) csPtr); |