summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2014-02-18 21:27:35 (GMT)
committerdgp <dgp@users.sourceforge.net>2014-02-18 21:27:35 (GMT)
commit9afa8a13e86fbd71a030ead7909cbe7d7db76296 (patch)
tree9015e661bca850c275c8b3a6007d9eb37c934f5b
parent997ad71bccf25cf78178d99b5bd94103ef365e4d (diff)
downloadtcl-9afa8a13e86fbd71a030ead7909cbe7d7db76296.zip
tcl-9afa8a13e86fbd71a030ead7909cbe7d7db76296.tar.gz
tcl-9afa8a13e86fbd71a030ead7909cbe7d7db76296.tar.bz2
Another coverage test that reveals refactoring error.
-rw-r--r--generic/tclIO.c2
-rw-r--r--tests/io.test14
2 files changed, 15 insertions, 1 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c
index 4197dc0..c862923 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -8880,10 +8880,10 @@ CopyAndTranslateBuffer(
* If there is a held-back "\r" at EOF, produce it now.
*/
- Tcl_Panic("Untested");
if (bytesInBuffer == 0) {
if ((statePtr->flags & (INPUT_SAW_CR | CHANNEL_EOF)) ==
(INPUT_SAW_CR | CHANNEL_EOF)) {
+ Tcl_Panic("Untested");
result[0] = '\r';
ResetFlag(statePtr, INPUT_SAW_CR);
return 1;
diff --git a/tests/io.test b/tests/io.test
index 0c2944b..4df44a3 100644
--- a/tests/io.test
+++ b/tests/io.test
@@ -6758,6 +6758,20 @@ test io-52.13 {coverage of -translation cr} {
close $out
file size $path(test2)
} 30
+test io-52.14 {coverage of -translation crlf} {
+ file delete $path(test1) $path(test2)
+ set out [open $path(test1) wb]
+ chan configure $out -translation lf
+ puts -nonewline $out abcdefg\rhijklmn\nopqrstu\r\nvwxyz
+ close $out
+ set in [open $path(test1)]
+ chan configure $in -buffersize 8 -translation crlf
+ set out [open $path(test2) w]
+ fcopy $in $out
+ close $in
+ close $out
+ file size $path(test2)
+} 29
test io-53.1 {CopyData} {fcopy} {
file delete $path(test1)