summaryrefslogtreecommitdiffstats
path: root/generic/tclIO.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2014-04-29 16:36:39 (GMT)
committerdgp <dgp@users.sourceforge.net>2014-04-29 16:36:39 (GMT)
commitd406bc02245e98984ec2097cea8188fa3f8ded52 (patch)
treecf2f5e7ecc7d4ff714d94712998b08bcf3840540 /generic/tclIO.c
parentfe4debabde73db9d51c655f61d19bc8d23956668 (diff)
parent0725c745416a8cfec6c72440cfc62d5fdc686f04 (diff)
downloadtcl-d406bc02245e98984ec2097cea8188fa3f8ded52.zip
tcl-d406bc02245e98984ec2097cea8188fa3f8ded52.tar.gz
tcl-d406bc02245e98984ec2097cea8188fa3f8ded52.tar.bz2
Fix bug exposed when buffer recycling is disabled.
Diffstat (limited to 'generic/tclIO.c')
-rw-r--r--generic/tclIO.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c
index a60c97d..08d0d93 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -3142,7 +3142,8 @@ Tcl_Close(
stickyError = 0;
- if ((statePtr->encoding != NULL) && (statePtr->curOutPtr != NULL)
+ if ((statePtr->encoding != NULL)
+ && !(statePtr->outputEncodingFlags & TCL_ENCODING_START)
&& (CheckChannelErrors(statePtr, TCL_WRITABLE) == 0)) {
statePtr->outputEncodingFlags |= TCL_ENCODING_END;
if (WriteChars(chanPtr, "", 0) < 0) {
@@ -7330,7 +7331,8 @@ Tcl_SetChannelOption(
* iso2022, the terminated escape sequence must write to the buffer.
*/
- if ((statePtr->encoding != NULL) && (statePtr->curOutPtr != NULL)
+ if ((statePtr->encoding != NULL)
+ && !(statePtr->outputEncodingFlags & TCL_ENCODING_START)
&& (CheckChannelErrors(statePtr, TCL_WRITABLE) == 0)) {
statePtr->outputEncodingFlags |= TCL_ENCODING_END;
WriteChars(chanPtr, "", 0);