summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2023-03-20 14:18:47 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2023-03-20 14:18:47 (GMT)
commit5319a7d93f431d1921f3c93112027d79e43b988a (patch)
tree876bc2d3f9e2f8a8b6c98280ce227aadcbcb97a3
parentb273a9c1d4c036fce56101f8723037d491d6618f (diff)
downloadtcl-5319a7d93f431d1921f3c93112027d79e43b988a.zip
tcl-5319a7d93f431d1921f3c93112027d79e43b988a.tar.gz
tcl-5319a7d93f431d1921f3c93112027d79e43b988a.tar.bz2
Fix [bdcb5126c0]: Failed assertion in test chan-io-7.3
-rw-r--r--generic/tclEncoding.c3
-rw-r--r--tests/chanio.test2
-rw-r--r--tests/io.test2
3 files changed, 4 insertions, 3 deletions
diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c
index 35b74c7..93e4171 100644
--- a/generic/tclEncoding.c
+++ b/generic/tclEncoding.c
@@ -3424,7 +3424,8 @@ TableToUtfProc(
} else if (PROFILE_REPLACE(flags)) {
ch = UNICODE_REPLACE_CHAR;
} else {
- numChars++; /* Silently consume */
+ src--; /* See bug [bdcb5126c0] */
+ result = TCL_CONVERT_MULTIBYTE;
break;
}
} else {
diff --git a/tests/chanio.test b/tests/chanio.test
index b73e681..d2008e6 100644
--- a/tests/chanio.test
+++ b/tests/chanio.test
@@ -1104,7 +1104,7 @@ test chan-io-7.3 {FilterInputBytes: split up character at EOF} -setup {
lappend x [chan gets $f line] $line
} -cleanup {
chan close $f
-} -result [list 15 "123456789012301" 17 1 1 -1 ""]
+} -result [list 15 "123456789012301" 18 0 1 -1 ""]
test chan-io-7.4 {FilterInputBytes: recover from split up character} -setup {
variable x ""
} -constraints {stdio fileevent} -body {
diff --git a/tests/io.test b/tests/io.test
index eb4abbd..c3c0cdd 100644
--- a/tests/io.test
+++ b/tests/io.test
@@ -1136,7 +1136,7 @@ test io-7.3 {FilterInputBytes: split up character at EOF} {testchannel} {
lappend x [gets $f line] $line
close $f
set x
-} [list 15 "123456789012301" 17 1 1 -1 ""]
+} [list 15 "123456789012301" 18 0 1 -1 ""]
test io-7.4 {FilterInputBytes: recover from split up character} {stdio fileevent} {
set f [open "|[list [interpreter] $path(cat)]" w+]
fconfigure $f -encoding binary -buffering none