diff options
author | dgp <dgp@users.sourceforge.net> | 2014-04-29 15:54:03 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2014-04-29 15:54:03 (GMT) |
commit | 0725c745416a8cfec6c72440cfc62d5fdc686f04 (patch) | |
tree | f4bfc12b5d150f12aabc9e5e995195b10d2d2739 | |
parent | 1fc337bda0ffe4523e3a47f27077378b4c1349cf (diff) | |
download | tcl-0725c745416a8cfec6c72440cfc62d5fdc686f04.zip tcl-0725c745416a8cfec6c72440cfc62d5fdc686f04.tar.gz tcl-0725c745416a8cfec6c72440cfc62d5fdc686f04.tar.bz2 |
Revise the logic for setting TCL_ENCODING_END in the outputEncodingFlagsdgp_no_buffer_recycle
so it does not rely on buffer recycling.
-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 3f9ca0a..6ff8806 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); |