summaryrefslogtreecommitdiffstats
path: root/generic/tclUtf.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-05-21 09:38:05 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-05-21 09:38:05 (GMT)
commit52ae090e68314dd4aad0ba73e0869527bb321db4 (patch)
tree9dc61a4a45919373736ecb538eb905a029c8acfd /generic/tclUtf.c
parentf193acf08ce4f3fe6db1cb79ab3589d037e5853c (diff)
downloadtcl-52ae090e68314dd4aad0ba73e0869527bb321db4.zip
tcl-52ae090e68314dd4aad0ba73e0869527bb321db4.tar.gz
tcl-52ae090e68314dd4aad0ba73e0869527bb321db4.tar.bz2
Slight improvement: if cs = "\xC0\x80" and ct = "\x00", loop would continue after NUL-byte, this should not happen.
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);
}