summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authormdejong <mdejong>2003-03-06 10:10:19 (GMT)
committermdejong <mdejong>2003-03-06 10:10:19 (GMT)
commit532758ed47adda0642397dddb71185eb564a7432 (patch)
treee2d1fc5e8cd617983609e95e0c820f1d59f162d9 /generic
parentc2ce0bdf9e6f8693a01148c0a34d49020712fd65 (diff)
downloadtcl-532758ed47adda0642397dddb71185eb564a7432.zip
tcl-532758ed47adda0642397dddb71185eb564a7432.tar.gz
tcl-532758ed47adda0642397dddb71185eb564a7432.tar.bz2
* generic/tclIO.c (Tcl_Flush): Compare the
nextAdded member of the ChannelBuffer to the nextRemoved member to determine if any output has been buffered. The previous check against the value 0 seems to have just been a coding error. See other methods like Tcl_OutputBuffered for examples where nextAdded is compared to nextRemoved to find the number of bytes buffered.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclIO.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c
index 4ffcfb2..9f992f0 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.64 2003/03/06 09:58:44 mdejong Exp $
+ * RCS: @(#) $Id: tclIO.c,v 1.65 2003/03/06 10:10:24 mdejong Exp $
*/
#include "tclInt.h"
@@ -5118,7 +5118,8 @@ Tcl_Flush(chan)
*/
if ((statePtr->curOutPtr != NULL)
- && (statePtr->curOutPtr->nextAdded > 0)) {
+ && (statePtr->curOutPtr->nextAdded >
+ statePtr->curOutPtr->nextRemoved)) {
statePtr->flags |= BUFFER_READY;
}