diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-04-14 14:30:35 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-04-14 14:30:35 (GMT) |
commit | 6a0b66fc79d01eac04951c8d0bd0a4412c3b9c91 (patch) | |
tree | 740553533208a7d59ce076bc595179164dfb10ee /generic/tclCmdMZ.c | |
parent | 527a481e1a5488fe6c9f00e9b9531b78c52ca8cc (diff) | |
parent | 1faed93cada29bd263dfed0b7b5df50e86defd39 (diff) | |
download | tcl-6a0b66fc79d01eac04951c8d0bd0a4412c3b9c91.zip tcl-6a0b66fc79d01eac04951c8d0bd0a4412c3b9c91.tar.gz tcl-6a0b66fc79d01eac04951c8d0bd0a4412c3b9c91.tar.bz2 |
Merge 8.7
Diffstat (limited to 'generic/tclCmdMZ.c')
-rw-r--r-- | generic/tclCmdMZ.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index bc7874a..83047ed 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -1848,7 +1848,7 @@ StringIsCmd( * if it is the first "element" that has the failure. */ - while (TclIsSpaceProc(*p)) { + while (TclIsSpaceProcM(*p)) { p++; } TclNewStringObj(tmpStr, string1, p-string1); @@ -2524,12 +2524,22 @@ StringStartCmd( cur = 0; if (index + 1 > 1) { p = Tcl_UtfAtIndex(string, index); + + TclUtfToUCS4(p, &ch); for (cur = index; cur != TCL_INDEX_NONE; cur--) { - TclUtfToUCS4(p, &ch); + int delta = 0; + const char *next; + if (!Tcl_UniCharIsWordChar(ch)) { break; } - p = Tcl_UtfPrev(p, string); + + next = Tcl_UtfPrev(p, string); + do { + next += delta; + delta = TclUtfToUCS4(next, &ch); + } while (next + delta < p); + p = next; } if (cur != index) { cur += 1; |