diff options
author | dgp <dgp@users.sourceforge.net> | 2014-04-29 16:47:48 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2014-04-29 16:47:48 (GMT) |
commit | b648be8b339531ac4f5f2aadd42094bccaa7b758 (patch) | |
tree | 9db95a4680256c95cb043d1e64089224e1920afa /generic | |
parent | 9a76d245a9dcf48449c6f147252a9be6b43abf09 (diff) | |
parent | d406bc02245e98984ec2097cea8188fa3f8ded52 (diff) | |
download | tcl-b648be8b339531ac4f5f2aadd42094bccaa7b758.zip tcl-b648be8b339531ac4f5f2aadd42094bccaa7b758.tar.gz tcl-b648be8b339531ac4f5f2aadd42094bccaa7b758.tar.bz2 |
Fix bug exposed when buffer recycling is disabled.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclIO.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c index e6439ef..673497b 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -3203,7 +3203,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) { @@ -7734,7 +7735,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); |