summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2021-03-02 10:53:30 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2021-03-02 10:53:30 (GMT)
commit773a30a541bb7f3681c3e0dc08b5c9d7e23fbaed (patch)
treeb1cdf702370dad22d343d153f3089a4499696d7b /generic
parentb697c844add273719e0d724f0e7680d215a0b163 (diff)
downloadtcl-773a30a541bb7f3681c3e0dc08b5c9d7e23fbaed.zip
tcl-773a30a541bb7f3681c3e0dc08b5c9d7e23fbaed.tar.gz
tcl-773a30a541bb7f3681c3e0dc08b5c9d7e23fbaed.tar.bz2
Using 0xFC00 is more readable here than ~0x3FF. It's sufficient becauwe ch1 and ch2 are only 16-bit. Backported from 8.7
Diffstat (limited to 'generic')
-rw-r--r--generic/tclUtf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/generic/tclUtf.c b/generic/tclUtf.c
index 65a3f41..57e58c1 100644
--- a/generic/tclUtf.c
+++ b/generic/tclUtf.c
@@ -1296,11 +1296,11 @@ Tcl_UtfNcmp(
if (ch1 != ch2) {
#if TCL_UTF_MAX == 4
/* Surrogates always report higher than non-surrogates */
- if (((ch1 & ~0x3FF) == 0xD800)) {
- if ((ch2 & ~0x3FF) != 0xD800) {
+ if (((ch1 & 0xFC00) == 0xD800)) {
+ if ((ch2 & 0xFC00) != 0xD800) {
return ch1;
}
- } else if ((ch2 & ~0x3FF) == 0xD800) {
+ } else if ((ch2 & 0xFC00) == 0xD800) {
return -ch2;
}
#endif