summaryrefslogtreecommitdiffstats
path: root/generic/tclIO.c
diff options
context:
space:
mode:
authorandreas_kupries <andreas_kupries@noemail.net>2001-11-07 04:47:54 (GMT)
committerandreas_kupries <andreas_kupries@noemail.net>2001-11-07 04:47:54 (GMT)
commit20a168affff02acdd2f0c17a712b361983477feb (patch)
treedae814c6e3697df6a4687157f1048d86010ef9b8 /generic/tclIO.c
parentf54664f38efdfa383034cea54310adc826ca9439 (diff)
downloadtcl-20a168affff02acdd2f0c17a712b361983477feb.zip
tcl-20a168affff02acdd2f0c17a712b361983477feb.tar.gz
tcl-20a168affff02acdd2f0c17a712b361983477feb.tar.bz2
See ChangeLog
FossilOrigin-Name: 755139d84baa2a5ab08b48c8b777f50a470b723e
Diffstat (limited to 'generic/tclIO.c')
-rw-r--r--generic/tclIO.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c
index a5979e2..982d6ff 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.40 2001/10/16 05:31:18 dgp Exp $
+ * RCS: @(#) $Id: tclIO.c,v 1.41 2001/11/07 04:47:54 andreas_kupries Exp $
*/
#include "tclInt.h"
@@ -4642,13 +4642,23 @@ ReadChars(statePtr, objPtr, charsToRead, offsetPtr, factorPtr)
nextPtr = bufPtr->nextPtr;
if (nextPtr == NULL) {
- /*
- * There isn't enough data in the buffers to complete the next
- * character, so we need to wait for more data before the next
- * file event can be delivered.
- */
+ if (srcLen > 0) {
+ /*
+ * There isn't enough data in the buffers to complete the next
+ * character, so we need to wait for more data before the next
+ * file event can be delivered.
+ *
+ * SF #478856.
+ *
+ * The exception to this is if the input buffer was
+ * completely empty before we tried to convert its
+ * contents. Nothing in, nothing out, and no incomplete
+ * character data. The conversion before the current one
+ * was complete.
+ */
- statePtr->flags |= CHANNEL_NEED_MORE_DATA;
+ statePtr->flags |= CHANNEL_NEED_MORE_DATA;
+ }
return -1;
}
nextPtr->nextRemoved -= srcLen;