summaryrefslogtreecommitdiffstats
path: root/generic/tkTextIndex.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2016-09-16 07:49:21 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2016-09-16 07:49:21 (GMT)
commit41d3c8f67e62fe307c46c91e5a42b71e39c59334 (patch)
tree0c7c6348e421d05be040ec77ef8a7200c85c391d /generic/tkTextIndex.c
parent9759a4f9b6f61757dc505a923c07951e560e47a3 (diff)
downloadtk-41d3c8f67e62fe307c46c91e5a42b71e39c59334.zip
tk-41d3c8f67e62fe307c46c91e5a42b71e39c59334.tar.gz
tk-41d3c8f67e62fe307c46c91e5a42b71e39c59334.tar.bz2
Patch from Christian Werner, for evaluation
Diffstat (limited to 'generic/tkTextIndex.c')
-rw-r--r--generic/tkTextIndex.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/generic/tkTextIndex.c b/generic/tkTextIndex.c
index 92ca03b..f64a6d2 100644
--- a/generic/tkTextIndex.c
+++ b/generic/tkTextIndex.c
@@ -2298,9 +2298,13 @@ StartEnd(
int chSize = 1;
if (segPtr->typePtr == &tkTextCharType) {
+#if TCL_UTF_MAX == 4
+ int ch;
+ chSize = TkUtfToUniChar32(segPtr->body.chars + offset, &ch);
+#else
Tcl_UniChar ch;
-
chSize = Tcl_UtfToUniChar(segPtr->body.chars + offset, &ch);
+#endif
if (!Tcl_UniCharIsWordChar(ch)) {
break;
}
@@ -2343,9 +2347,13 @@ StartEnd(
int chSize = 1;
if (segPtr->typePtr == &tkTextCharType) {
+#if TCL_UTF_MAX == 4
+ int ch;
+ TkUtfToUniChar32(segPtr->body.chars + offset, &ch);
+#else
Tcl_UniChar ch;
-
Tcl_UtfToUniChar(segPtr->body.chars + offset, &ch);
+#endif
if (!Tcl_UniCharIsWordChar(ch)) {
break;
}