summaryrefslogtreecommitdiffstats
path: root/generic/tclIO.c
diff options
context:
space:
mode:
authordgp@users.sourceforge.net <dgp>2011-08-19 19:07:17 (GMT)
committerdgp@users.sourceforge.net <dgp>2011-08-19 19:07:17 (GMT)
commit3f77f74d380a1696d1c7cce78a8e16a34b09e824 (patch)
tree92deb26629aacc8365e068d9b1361fc527393f3a /generic/tclIO.c
parent26d7e2d04854b4dd8b9ac440469a155b38f98f0b (diff)
downloadtcl-3f77f74d380a1696d1c7cce78a8e16a34b09e824.zip
tcl-3f77f74d380a1696d1c7cce78a8e16a34b09e824.tar.gz
tcl-3f77f74d380a1696d1c7cce78a8e16a34b09e824.tar.bz2
3394654, 3393276 Revise FlushChannel() to account for the possibility
that the ChanWrite() call might recycle the buffer out from under us.
Diffstat (limited to 'generic/tclIO.c')
-rw-r--r--generic/tclIO.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c
index 946b53a..ae1b89a 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -2510,7 +2510,9 @@ FlushChannel(
wroteSome = 1;
}
- bufPtr->nextRemoved += written;
+ if (!IsBufferEmpty(bufPtr)) {
+ bufPtr->nextRemoved += written;
+ }
/*
* If this buffer is now empty, recycle it.