diff options
| -rw-r--r-- | generic/tclUtf.c | 4 | ||||
| -rw-r--r-- | tests/utf.test | 14 |
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 |
