summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2020-04-02 21:29:26 (GMT)
committerdgp <dgp@users.sourceforge.net>2020-04-02 21:29:26 (GMT)
commit2f92315df0eafedcd9c06b98df46e3ce71701cb2 (patch)
tree9eb2848f646ff66f25b3a3787c822e67b6f9c10d
parentc583e934033ce158b9b2b03320ecd598e908efcc (diff)
downloadtcl-2f92315df0eafedcd9c06b98df46e3ce71701cb2.zip
tcl-2f92315df0eafedcd9c06b98df46e3ce71701cb2.tar.gz
tcl-2f92315df0eafedcd9c06b98df46e3ce71701cb2.tar.bz2
One more caller conversion that simplifies.
There may be other callers of TclUtfToUniChar that would be made more correct or consistent with a similar conversion.
-rw-r--r--generic/tclScan.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/generic/tclScan.c b/generic/tclScan.c
index 4b9298d..c599797 100644
--- a/generic/tclScan.c
+++ b/generic/tclScan.c
@@ -881,14 +881,7 @@ Tcl_ScanObjCmd(
* Scan a single Unicode character.
*/
- offset = TclUtfToUniChar(string, &sch);
- i = (int)sch;
-#if TCL_UTF_MAX == 4
- if ((sch >= 0xD800) && (offset < 3)) {
- offset += TclUtfToUniChar(string+offset, &sch);
- i = (((i<<10) & 0x0FFC00) + 0x10000) + (sch & 0x3FF);
- }
-#endif
+ offset = TclUtfToUCS4(string, &i);
string += offset;
if (!(flags & SCAN_SUPPRESS)) {
objPtr = Tcl_NewIntObj(i);