summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tclUtf.c10
-rw-r--r--tests/utf.test14
2 files changed, 9 insertions, 15 deletions
diff --git a/generic/tclUtf.c b/generic/tclUtf.c
index a67e5e7..3377b70 100644
--- a/generic/tclUtf.c
+++ b/generic/tclUtf.c
@@ -67,13 +67,7 @@ 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,
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
- 4,4,4,4,4,
-#else
- 1,1,1,1,1,
-#endif
- 1,1,1,1,1,1,1,1,1,1,1
+ 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,1,1,1,1,1,1,1,1,1,1,1
};
static const unsigned char complete[256] = {
@@ -745,7 +739,7 @@ Tcl_UtfPrev(
int i, byte;
look = --src;
- for (i = 0; i < TCL_UTF_MAX; i++) {
+ for (i = 0; i < 4; i++) {
if (look < start) {
if (src < start) {
src = start;
diff --git a/tests/utf.test b/tests/utf.test
index 103e39b..1b7b409 100644
--- a/tests/utf.test
+++ b/tests/utf.test
@@ -223,13 +223,13 @@ test utf-7.9.2 {Tcl_UtfPrev} testutfprev {
} 2
test utf-7.10 {Tcl_UtfPrev} testutfprev {
testutfprev A\xF4\xA0
-} 2
+} 1
test utf-7.10.1 {Tcl_UtfPrev} testutfprev {
testutfprev A\xF4\xA0\xA0\xA0 3
-} 2
+} 1
test utf-7.10.2 {Tcl_UtfPrev} testutfprev {
testutfprev A\xF4\xA0\xF8\xA0 3
-} 2
+} 1
test utf-7.11 {Tcl_UtfPrev} testutfprev {
testutfprev A\xE8\xA0
} 1
@@ -268,13 +268,13 @@ test utf-7.14.2 {Tcl_UtfPrev} testutfprev {
} 3
test utf-7.15 {Tcl_UtfPrev} testutfprev {
testutfprev A\xF4\xA0\xA0
-} 3
+} 1
test utf-7.15.1 {Tcl_UtfPrev} testutfprev {
testutfprev A\xF4\xA0\xA0\xA0 4
-} 3
+} 1
test utf-7.15.2 {Tcl_UtfPrev} testutfprev {
testutfprev A\xF4\xA0\xA0\xF8 4
-} 3
+} 1
test utf-7.16 {Tcl_UtfPrev} testutfprev {
testutfprev A\xE8\xA0\xA0
} 1
@@ -307,7 +307,7 @@ test utf-7.19 {Tcl_UtfPrev} testutfprev {
} 4
test utf-7.20 {Tcl_UtfPrev} testutfprev {
testutfprev A\xF4\xA0\xA0\xA0
-} 4
+} 1
test utf-7.21 {Tcl_UtfPrev} testutfprev {
testutfprev A\xE8\xA0\xA0\xA0
} 4