From 532758ed47adda0642397dddb71185eb564a7432 Mon Sep 17 00:00:00 2001 From: mdejong Date: Thu, 6 Mar 2003 10:10:19 +0000 Subject: * 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. --- ChangeLog | 11 +++++++++++ generic/tclIO.c | 5 +++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index c057284..132c94b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,16 @@ 2003-03-06 Mo DeJong + * 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. + +2003-03-06 Mo DeJong + * generic/tclIO.c (Tcl_GetsObj): Check that the eol pointer has not gone past the end of the string when in auto translation 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; } -- cgit v0.12