diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-01-22 23:35:38 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-01-22 23:35:38 (GMT) |
commit | c5f7f66cebff43a88665d40e6bc51504ed09831d (patch) | |
tree | d8417ae8e2efef9361aea638003a10186426af33 /generic/tclEncoding.c | |
parent | 2b516939bd2d4aae1f1b2b8c561419146d99c978 (diff) | |
parent | b31d88647917b263f24740bbceb02476d418a9fb (diff) | |
download | tcl-c5f7f66cebff43a88665d40e6bc51504ed09831d.zip tcl-c5f7f66cebff43a88665d40e6bc51504ed09831d.tar.gz tcl-c5f7f66cebff43a88665d40e6bc51504ed09831d.tar.bz2 |
Merge 8.7
Diffstat (limited to 'generic/tclEncoding.c')
-rw-r--r-- | generic/tclEncoding.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c index 1bc9e6a..e548663 100644 --- a/generic/tclEncoding.c +++ b/generic/tclEncoding.c @@ -10,6 +10,7 @@ */ #include "tclInt.h" +#include "tclIO.h" typedef size_t (LengthProc)(const char *src); @@ -2323,9 +2324,9 @@ 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) || (flags & ENCODING_FAILINDEX))) { /* - * If in input mode, and -strict is specified: This is an error. + * If in input mode, and -strict or -failindex is specified: This is an error. */ if (flags & TCL_ENCODING_MODIFIED) { result = TCL_CONVERT_SYNTAX; @@ -2350,7 +2351,7 @@ UtfToUtfProc( result = TCL_CONVERT_MULTIBYTE; break; } - if (((flags & TCL_ENCODING_STRICT) == TCL_ENCODING_STRICT)) { + if (((flags & TCL_ENCODING_STRICT) == TCL_ENCODING_STRICT) || (flags & ENCODING_FAILINDEX)) { result = TCL_CONVERT_SYNTAX; break; } |