summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-05-12 19:20:20 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-05-12 19:20:20 (GMT)
commit24e4669c51e1dbe148a0bba31d38e5c626d4b075 (patch)
tree605a679d4667b84ae83d471ad99266cc4a9e7ebb /generic
parent6256643a39bd87d514f7c7455652ace83dd7f95c (diff)
downloadtcl-24e4669c51e1dbe148a0bba31d38e5c626d4b075.zip
tcl-24e4669c51e1dbe148a0bba31d38e5c626d4b075.tar.gz
tcl-24e4669c51e1dbe148a0bba31d38e5c626d4b075.tar.bz2
Revert implementation of Tcl_UniCharAtIndex() change done in this commit: [6596c4af31e29b5d]. Just look at the Tcl_UtfAtIndex() implementation for TCL_UTF_MAX=4: It's not the same.
There are no test-cases for Tcl_UniCharAtIndex(), see [f45d0dc1a7], not really worth to write one, since the implementation of this function didn't change in 20 years.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclUtf.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/generic/tclUtf.c b/generic/tclUtf.c
index 9596aed..c7f8a94 100644
--- a/generic/tclUtf.c
+++ b/generic/tclUtf.c
@@ -937,7 +937,9 @@ Tcl_UniCharAtIndex(
{
Tcl_UniChar ch = 0;
- TclUtfToUniChar(Tcl_UtfAtIndex(src, index), &ch);
+ while (index-- >= 0) {
+ src += TclUtfToUniChar(src, &ch);
+ }
return ch;
}