diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-01-24 20:05:00 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-01-24 20:05:00 (GMT) |
commit | 97041036d3837f2043eb4a5d4d9b44ad79038ddd (patch) | |
tree | 616721088a7c3333242c0577d63f2d5178272086 | |
parent | ef42e37c44f9b463e4e873a66f9add243cc83046 (diff) | |
parent | 1dd572d476fbff934a84ba34dddbad744ce96091 (diff) | |
download | tcl-97041036d3837f2043eb4a5d4d9b44ad79038ddd.zip tcl-97041036d3837f2043eb4a5d4d9b44ad79038ddd.tar.gz tcl-97041036d3837f2043eb4a5d4d9b44ad79038ddd.tar.bz2 |
Merge 8.7
-rw-r--r-- | generic/tclIO.c | 8 | ||||
-rw-r--r-- | tests/chanio.test | 12 | ||||
-rw-r--r-- | tests/io.test | 12 | ||||
-rw-r--r-- | tests/iogt.test | 2 |
4 files changed, 19 insertions, 15 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); diff --git a/tests/chanio.test b/tests/chanio.test index 33e9937..f02711e 100644 --- a/tests/chanio.test +++ b/tests/chanio.test @@ -6700,8 +6700,8 @@ test chan-io-52.3 {TclCopyChannel} -constraints {fcopy} -setup { } -body { set f1 [open $thisScript] set f2 [open $path(test1) w] - chan configure $f1 -translation lf -blocking 0 - chan configure $f2 -translation cr -blocking 0 + chan configure $f1 -translation lf -encoding iso8859-1 -blocking 0 + chan configure $f2 -translation cr -encoding iso8859-1 -blocking 0 set s0 [chan copy $f1 $f2] set result [list [chan configure $f1 -blocking] [chan configure $f2 -blocking]] chan close $f1 @@ -6779,8 +6779,8 @@ test chan-io-52.6 {TclCopyChannel} -setup { } -constraints {fcopy} -body { set f1 [open $thisScript] set f2 [open $path(test1) w] - chan configure $f1 -translation lf -blocking 0 - chan configure $f2 -translation lf -blocking 0 + chan configure $f1 -translation lf -encoding iso8859-1 -blocking 0 + chan configure $f2 -translation lf -encoding iso8859-1 -blocking 0 set s0 [chan copy $f1 $f2 -size [expr {[file size $thisScript] + 5}]] set result [list [chan configure $f1 -blocking] [chan configure $f2 -blocking]] chan close $f1 @@ -6915,8 +6915,8 @@ test chan-io-53.2 {CopyData} -setup { } -constraints {fcopy} -body { set f1 [open $thisScript] set f2 [open $path(test1) w] - chan configure $f1 -translation lf -blocking 0 - chan configure $f2 -translation cr -blocking 0 + chan configure $f1 -translation lf -encoding iso8859-1 -blocking 0 + chan configure $f2 -translation cr -encoding iso8859-1 -blocking 0 chan copy $f1 $f2 -command [namespace code {set s0}] set result [list [chan configure $f1 -blocking] [chan configure $f2 -blocking]] variable s0 diff --git a/tests/io.test b/tests/io.test index 4f93e8a..919ea8b 100644 --- a/tests/io.test +++ b/tests/io.test @@ -7239,8 +7239,8 @@ test io-52.3 {TclCopyChannel} {fcopy} { file delete $path(test1) set f1 [open $thisScript] set f2 [open $path(test1) w] - fconfigure $f1 -translation lf -blocking 0 - fconfigure $f2 -translation cr -blocking 0 + fconfigure $f1 -translation lf -encoding iso8859-1 -blocking 0 + fconfigure $f2 -translation cr -encoding iso8859-1 -blocking 0 set s0 [fcopy $f1 $f2] set result [list [fconfigure $f1 -blocking] [fconfigure $f2 -blocking]] close $f1 @@ -7331,8 +7331,8 @@ test io-52.6 {TclCopyChannel} {fcopy} { file delete $path(test1) set f1 [open $thisScript] set f2 [open $path(test1) w] - fconfigure $f1 -translation lf -blocking 0 - fconfigure $f2 -translation lf -blocking 0 + fconfigure $f1 -translation lf -encoding iso8859-1 -blocking 0 + fconfigure $f2 -translation lf -encoding iso8859-1 -blocking 0 set s0 [fcopy $f1 $f2 -size [expr {[file size $thisScript] + 5}]] set result [list [fconfigure $f1 -blocking] [fconfigure $f2 -blocking]] close $f1 @@ -7626,8 +7626,8 @@ test io-53.2 {CopyData} {fcopy} { file delete $path(test1) set f1 [open $thisScript] set f2 [open $path(test1) w] - fconfigure $f1 -translation lf -blocking 0 - fconfigure $f2 -translation cr -blocking 0 + fconfigure $f1 -translation lf -encoding iso8859-1 -blocking 0 + fconfigure $f2 -translation cr -encoding iso8859-1 -blocking 0 fcopy $f1 $f2 -command [namespace code {set s0}] set result [list [fconfigure $f1 -blocking] [fconfigure $f2 -blocking]] variable s0 diff --git a/tests/iogt.test b/tests/iogt.test index d397ccb..279a0dd 100644 --- a/tests/iogt.test +++ b/tests/iogt.test @@ -575,11 +575,11 @@ read {%^&*()_+-= } query/maxRead {} -1 flush/read {} {} +query/maxRead {} -1 write %^&*()_+-= %^&*()_+-= write { } { } -query/maxRead {} -1 delete/read {} *ignored* flush/write {} {} delete/write {} *ignored*} |