From 5319a7d93f431d1921f3c93112027d79e43b988a Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 20 Mar 2023 14:18:47 +0000 Subject: Fix [bdcb5126c0]: Failed assertion in test chan-io-7.3 --- generic/tclEncoding.c | 3 ++- tests/chanio.test | 2 +- tests/io.test | 2 +- 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 -- cgit v0.12