summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 27e7278..f9a5e6a 100644
--- a/generic/tclEncoding.c
+++ b/generic/tclEncoding.c
@@ -3455,7 +3455,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 5aae994..ee6133e 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 7b96c51..538f554 100644
--- a/tests/io.test
+++ b/tests/io.test
@@ -1201,7 +1201,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