summaryrefslogtreecommitdiffstats
path: root/generic/tclUtf.c
diff options
context:
space:
mode:
authorjan.nijtmans <jan.nijtmans@noemail.net>2013-05-21 09:38:05 (GMT)
committerjan.nijtmans <jan.nijtmans@noemail.net>2013-05-21 09:38:05 (GMT)
commit25db48eebb2ab2fff1daeb7908f50008987c8e3e (patch)
tree9dc61a4a45919373736ecb538eb905a029c8acfd /generic/tclUtf.c
parentc06fa1354969f9d4115cc64ebf1c89a916d86e99 (diff)
downloadtcl-25db48eebb2ab2fff1daeb7908f50008987c8e3e.zip
tcl-25db48eebb2ab2fff1daeb7908f50008987c8e3e.tar.gz
tcl-25db48eebb2ab2fff1daeb7908f50008987c8e3e.tar.bz2
Slight improvement: if cs = "\xC0\x80" and ct = "\x00", loop would continue after NUL-byte, this should not happen.
FossilOrigin-Name: a765f37f7893e23f18bdc72a8e982cb2b5086eb9
Diffstat (limited to 'generic/tclUtf.c')
-rw-r--r--generic/tclUtf.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/generic/tclUtf.c b/generic/tclUtf.c
index 9dacb53..a7a2091 100644
--- a/generic/tclUtf.c
+++ b/generic/tclUtf.c
@@ -1110,12 +1110,12 @@ TclUtfCasecmp(
CONST char *ct) /* UTF string cs is compared to. */
{
Tcl_UniChar ch1, ch2;
- char c;
+ int goOn;
do {
- /* If c == '\0', loop should end. */
- c = *cs;
+ /* If *cs == '\0' or *ct == '\0', loop should end. */
+ goOn = *cs && *ct;
cs += TclUtfToUniChar(cs, &ch1);
ct += TclUtfToUniChar(ct, &ch2);
@@ -1124,7 +1124,7 @@ TclUtfCasecmp(
ch2 = Tcl_UniCharToLower(ch2);
if (ch1 != ch2) break;
}
- } while (c);
+ } while (goOn);
return (ch1 - ch2);
}