From 768fa22c43bfd6228f6e09e81dfebed70c1a9244 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 9 Dec 2022 10:22:11 +0000 Subject: Partial solution for [b8f575aa23]. Still missing: 1) testcases. 2) What if both EOF and ENCODING_ERROR happens (because there is both an eofchar and an invalid byte in the stream) --- generic/tclIO.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tclIO.c b/generic/tclIO.c index 8e4ecee..afe6aec 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -7588,7 +7588,7 @@ Tcl_Eof( ChannelState *statePtr = ((Channel *) chan)->state; /* State of real channel structure. */ - return GotFlag(statePtr, CHANNEL_EOF) ? 1 : 0; + return (GotFlag(statePtr, CHANNEL_EOF) && !GotFlag(statePtr, CHANNEL_ENCODING_ERROR)) ? 1 : 0; } /* -- cgit v0.12