diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-04-05 20:28:06 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-04-05 20:28:06 (GMT) |
| commit | de914c0ed5be4090e8f066359dab792e7cb0c90f (patch) | |
| tree | 826713f6c04803b8239518c197fc30be10f6cbad /generic/tclUtf.c | |
| parent | 57d80b8062bd84389ce200cf7fd42c52b5466b07 (diff) | |
| download | tcl-de914c0ed5be4090e8f066359dab792e7cb0c90f.zip tcl-de914c0ed5be4090e8f066359dab792e7cb0c90f.tar.gz tcl-de914c0ed5be4090e8f066359dab792e7cb0c90f.tar.bz2 | |
Partial fix for [31aa44375de2c87e]: Tcl_NumUtfChars regression in default 8.6 build.
This commit brings Tcl_UtfCharComplete() into agreement with Tcl_UtfToUniChar(), whether it demands 1, 3 or 4 succeeding bytes.
Diffstat (limited to 'generic/tclUtf.c')
| -rw-r--r-- | generic/tclUtf.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/generic/tclUtf.c b/generic/tclUtf.c index 6782df9..410268d 100644 --- a/generic/tclUtf.c +++ b/generic/tclUtf.c @@ -64,11 +64,16 @@ static const unsigned char totalBytes[256] = { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +#if TCL_UTF_MAX > 4 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, +#else /* Tcl_UtfCharComplete() might point to 2nd byte of valid 4-byte sequence */ + 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, + 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, +#endif 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, -#if TCL_UTF_MAX > 3 +#if TCL_UTF_MAX > 4 4,4,4,4,4, #else 3,3,3,3,3, /* Tcl_UtfCharComplete() only checks TCL_UTF_MAX bytes */ |
