From 9dabd6f1accf6870c461a9ed5ae931aee09de1fe Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 19 Dec 2022 15:40:40 +0000 Subject: When changing the -nocomplainencoding or -strictencoding settings of a channel, reset the CHANNEL_NEED_MORE_DATA and CHANNEL_ENCODING_ERROR flags, so we can continue reading the channel and find out what's going on. --- generic/tclIO.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/generic/tclIO.c b/generic/tclIO.c index 730d963..e6e3560 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -8364,6 +8364,7 @@ Tcl_SetChannelOption( } #endif } + ResetFlag(statePtr, CHANNEL_NEED_MORE_DATA|CHANNEL_ENCODING_ERROR); return TCL_OK; } else if (HaveOpt(1, "-strictencoding")) { int newMode; @@ -8377,6 +8378,7 @@ Tcl_SetChannelOption( } else { ResetFlag(statePtr, CHANNEL_ENCODING_STRICT); } + ResetFlag(statePtr, CHANNEL_NEED_MORE_DATA|CHANNEL_ENCODING_ERROR); return TCL_OK; } else if (HaveOpt(1, "-translation")) { const char *readMode, *writeMode; -- cgit v0.12