summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2020-04-16 20:59:11 (GMT)
committerdgp <dgp@users.sourceforge.net>2020-04-16 20:59:11 (GMT)
commitd168b44ff69105f80110a01cda37279becc68dc5 (patch)
treefcd3909dd5245150d80ba3bd1a8245c8b8754b94
parent69a5e401cec7ab105b63420fa5294d883261891e (diff)
downloadtcl-d168b44ff69105f80110a01cda37279becc68dc5.zip
tcl-d168b44ff69105f80110a01cda37279becc68dc5.tar.gz
tcl-d168b44ff69105f80110a01cda37279becc68dc5.tar.bz2
Adjust test results and implementation for Tcl 8.6 current support of
4-byte sequences in a TCL_UTF_MAX=3 build.
-rw-r--r--generic/tclUtf.c4
-rw-r--r--tests/utf.test14
2 files changed, 9 insertions, 9 deletions
diff --git a/generic/tclUtf.c b/generic/tclUtf.c
index cd57d12..d6ba15c 100644
--- a/generic/tclUtf.c
+++ b/generic/tclUtf.c
@@ -897,10 +897,10 @@ Tcl_UtfPrev(
/* Continue the search backwards... */
look--;
- } while (trailBytesSeen < TCL_UTF_MAX);
+ } while (trailBytesSeen < /* was TCL_UTF_MAX */ 4);
/*
- * We've seen TCL_UTF_MAX trail bytes, so we know there will not be a
+ * We've seen 4 (was TCL_UTF_MAX) trail bytes, so we know there will not be a
* properly formed byte sequence to find, and we can stop looking,
* accepting the fallback.
*/
diff --git a/tests/utf.test b/tests/utf.test
index 3a2911f..76cf3fe 100644
--- a/tests/utf.test
+++ b/tests/utf.test
@@ -363,7 +363,7 @@ test utf-6.68 {Tcl_UtfNext} testutfnext {
} 1
test utf-6.69 {Tcl_UtfNext} testutfnext {
testutfnext \xF4\xA0\xA0\xA0
-} 1
+} 4
test utf-6.70 {Tcl_UtfNext} testutfnext {
testutfnext \xF4\xA0\xA0\xD0
} 1
@@ -378,22 +378,22 @@ test utf-6.73 {Tcl_UtfNext} testutfnext {
} 1
test utf-6.74 {Tcl_UtfNext} testutfnext {
testutfnext \xF4\xA0\xA0\xA0G
-} 1
+} 4
test utf-6.75 {Tcl_UtfNext} testutfnext {
testutfnext \xF4\xA0\xA0\xA0\xA0
-} 1
+} 4
test utf-6.76 {Tcl_UtfNext} testutfnext {
testutfnext \xF4\xA0\xA0\xA0\xD0
-} 1
+} 4
test utf-6.77 {Tcl_UtfNext} testutfnext {
testutfnext \xF4\xA0\xA0\xA0\xE8
-} 1
+} 4
test utf-6.78 {Tcl_UtfNext} testutfnext {
testutfnext \xF4\xA0\xA0\xA0\xF4
-} 1
+} 4
test utf-6.79 {Tcl_UtfNext} testutfnext {
testutfnext \xF4\xA0\xA0\xA0G\xF8
-} 1
+} 4
test utf-6.80 {Tcl_UtfNext - overlong sequences} testutfnext {
testutfnext \xC0\x80
} 2