diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-05-18 20:23:30 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-05-18 20:23:30 (GMT) |
commit | e54cad6de1c547761044db23d6b9358b00db2230 (patch) | |
tree | 288afd61ee41c0c8f9f1d2f9dda29ec145ae9b4c | |
parent | 04cc75b6f5e3fd31abae4090243d20e965f9d4e4 (diff) | |
download | tcl-e54cad6de1c547761044db23d6b9358b00db2230.zip tcl-e54cad6de1c547761044db23d6b9358b00db2230.tar.gz tcl-e54cad6de1c547761044db23d6b9358b00db2230.tar.bz2 |
Tiny fix for TCL_UTF_MAX=4 build only: Since Tcl_UtfNext() verifies 4 bytes for lead bytes F0-F5, Tcl_UtfCharComplete() should guarantee that those 4 bytes are available, not 3.
-rw-r--r-- | generic/tclUtf.c | 2 | ||||
-rw-r--r-- | tests/utf.test | 12 |
2 files changed, 4 insertions, 10 deletions
diff --git a/generic/tclUtf.c b/generic/tclUtf.c index 4454558..ed9138b 100644 --- a/generic/tclUtf.c +++ b/generic/tclUtf.c @@ -87,7 +87,7 @@ static const unsigned char complete[256] = { /* End of "continuation byte section" */ 2,1,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 > 4 +#if TCL_UTF_MAX > 3 4,4,4,4,4, #else 3,3,3,3,3, diff --git a/tests/utf.test b/tests/utf.test index 69ef1f4..14b2198 100644 --- a/tests/utf.test +++ b/tests/utf.test @@ -210,7 +210,7 @@ test utf-6.8 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext A[testbytestring \xF8] } 1 test utf-6.9 {Tcl_UtfNext} {testutfnext testbytestring} { - testutfnext [testbytestring \xA0] + testutfnext [testbytestring \xA0\x00] } 1 test utf-6.10 {Tcl_UtfNext} {testutfnext testbytestring} { testutfnext [testbytestring \xA0]G @@ -554,10 +554,7 @@ test utf-6.111 {Tcl_UtfNext, read limits} {testutfnext testbytestring} { test utf-6.112.0 {Tcl_UtfNext, read limits} {testutfnext testbytestring ucs2} { testutfnext [testbytestring \xF2\xA0\xA0\xA0]G 3 } 1 -test utf-6.112.1 {Tcl_UtfNext, read limits} {testutfnext testbytestring utf16} { - testutfnext [testbytestring \xF2\xA0\xA0\xA0]G 3 -} 4 -test utf-6.112.3 {Tcl_UtfNext, read limits} {testutfnext testbytestring ucs4} { +test utf-6.112.1 {Tcl_UtfNext, read limits} {testutfnext testbytestring fullutf} { testutfnext [testbytestring \xF2\xA0\xA0\xA0]G 3 } 0 test utf-6.113.0 {Tcl_UtfNext, read limits} {testutfnext testbytestring ucs2} { @@ -575,10 +572,7 @@ test utf-6.115 {Tcl_UtfNext, read limits} {testutfnext testbytestring} { test utf-6.116.0 {Tcl_UtfNext, read limits} {testutfnext testbytestring ucs2} { testutfnext [testbytestring \xF2\xA0\xA0\xA0\xA0] 3 } 1 -test utf-6.116.1 {Tcl_UtfNext, read limits} {testutfnext testbytestring utf16} { - testutfnext [testbytestring \xF2\xA0\xA0\xA0\xA0] 3 -} 4 -test utf-6.116.2 {Tcl_UtfNext, read limits} {testutfnext testbytestring ucs4} { +test utf-6.116.1 {Tcl_UtfNext, read limits} {testutfnext testbytestring fullutf} { testutfnext [testbytestring \xF2\xA0\xA0\xA0\xA0] 3 } 0 test utf-6.117.0 {Tcl_UtfNext, read limits} {testutfnext testbytestring ucs2} { |