summaryrefslogtreecommitdiffstats
path: root/generic/tclIO.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2023-01-24 20:05:00 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2023-01-24 20:05:00 (GMT)
commit97041036d3837f2043eb4a5d4d9b44ad79038ddd (patch)
tree616721088a7c3333242c0577d63f2d5178272086 /generic/tclIO.c
parentef42e37c44f9b463e4e873a66f9add243cc83046 (diff)
parent1dd572d476fbff934a84ba34dddbad744ce96091 (diff)
downloadtcl-97041036d3837f2043eb4a5d4d9b44ad79038ddd.zip
tcl-97041036d3837f2043eb4a5d4d9b44ad79038ddd.tar.gz
tcl-97041036d3837f2043eb4a5d4d9b44ad79038ddd.tar.bz2
Merge 8.7
Diffstat (limited to 'generic/tclIO.c')
-rw-r--r--generic/tclIO.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c
index cfb97ec..98315db 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -9347,7 +9347,9 @@ TclCopyChannel(
moveBytes = inStatePtr->inEofChar == '\0' /* No eofChar to stop input */
&& inStatePtr->inputTranslation == TCL_TRANSLATE_LF
&& outStatePtr->outputTranslation == TCL_TRANSLATE_LF
- && inStatePtr->encoding == outStatePtr->encoding;
+ && inStatePtr->encoding == outStatePtr->encoding
+ && (inStatePtr->flags & TCL_ENCODING_STRICT) != TCL_ENCODING_STRICT
+ && outStatePtr->flags & TCL_ENCODING_NOCOMPLAIN;
/*
* Allocate a new CopyState to maintain info about the current copy in
@@ -9674,7 +9676,9 @@ CopyData(
inBinary = (inStatePtr->encoding == NULL);
outBinary = (outStatePtr->encoding == NULL);
- sameEncoding = (inStatePtr->encoding == outStatePtr->encoding);
+ sameEncoding = inStatePtr->encoding == outStatePtr->encoding
+ && (inStatePtr->flags & TCL_ENCODING_STRICT) != TCL_ENCODING_STRICT
+ && outStatePtr->flags & TCL_ENCODING_NOCOMPLAIN;
if (!(inBinary || sameEncoding)) {
TclNewObj(bufObj);