summaryrefslogtreecommitdiffstats
path: root/generic/tclEncoding.c
diff options
context:
space:
mode:
authorpooryorick <com.digitalsmarties@pooryorick.com>2022-12-30 20:27:47 (GMT)
committerpooryorick <com.digitalsmarties@pooryorick.com>2022-12-30 20:27:47 (GMT)
commita801c2d4741015dbb5875938248eff1701e1ff29 (patch)
treea01ac109d5044cad7c553a96da6bca4cb986f60b /generic/tclEncoding.c
parent3b45005127de0885251471d5591ecb58c5b3e286 (diff)
downloadtcl-a801c2d4741015dbb5875938248eff1701e1ff29.zip
tcl-a801c2d4741015dbb5875938248eff1701e1ff29.tar.gz
tcl-a801c2d4741015dbb5875938248eff1701e1ff29.tar.bz2
Fix DoReadChars() to correctly discard encoding errors after eofchar has been seen, and add new test, io-75.8.invalid.
Diffstat (limited to 'generic/tclEncoding.c')
-rw-r--r--generic/tclEncoding.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c
index d10d9ca..37b3073 100644
--- a/generic/tclEncoding.c
+++ b/generic/tclEncoding.c
@@ -2386,7 +2386,12 @@ UtfToUtfProc(
*dst++ = *src++;
} else if ((UCHAR(*src) == 0xC0) && (src + 1 < srcEnd)
- && (UCHAR(src[1]) == 0x80) && (!(flags & TCL_ENCODING_MODIFIED) || ((flags & TCL_ENCODING_STRICT) == TCL_ENCODING_STRICT))) {
+ && (UCHAR(src[1]) == 0x80)
+ && (
+ !(flags & TCL_ENCODING_MODIFIED)
+ || ((flags & TCL_ENCODING_STRICT) == TCL_ENCODING_STRICT)
+ ))
+ {
/*
* If in input mode, and -strict is specified: This is an error.
*/