diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2018-01-11 14:11:38 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2018-01-11 14:11:38 (GMT) |
commit | eb3422673ff62a7427f2e6d166840fce68237d74 (patch) | |
tree | 4ecbbe5256100cf97614c9e9bab52211d46f1f47 /generic/tclCmdMZ.c | |
parent | 2a8fce94bd955c09dbca0c30494232894dfd9c33 (diff) | |
download | tcl-eb3422673ff62a7427f2e6d166840fce68237d74.zip tcl-eb3422673ff62a7427f2e6d166840fce68237d74.tar.gz tcl-eb3422673ff62a7427f2e6d166840fce68237d74.tar.bz2 |
Add test-cases for bug [11ae2be95dac9417], and make a start fixing it. Almost works.
Diffstat (limited to 'generic/tclCmdMZ.c')
-rw-r--r-- | generic/tclCmdMZ.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index a206cc5..a23f007 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -1435,7 +1435,7 @@ StringIndexCmd( } /* - * Get the char length to calulate what 'end' means. + * Get the char length to calculate what 'end' means. */ length = Tcl_GetCharLength(objv[1]); @@ -1444,7 +1444,15 @@ StringIndexCmd( } if ((index >= 0) && (index < length)) { - Tcl_UniChar ch = Tcl_GetUniChar(objv[1], index); + int ch = Tcl_GetUniChar(objv[1], index); + + if (ch >= 0x10000) { + printf("HI: %x\n", ch); + } + if (ch == -1) { + printf("LO: %x\n", ch); + return TCL_OK; + } /* * If we have a ByteArray object, we're careful to generate a new |