summaryrefslogtreecommitdiffstats
path: root/generic/tclUtf.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2001-04-06 10:50:00 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2001-04-06 10:50:00 (GMT)
commit8bccfa351c587aaf7e5d6aa27b0ef0141806c1cf (patch)
tree81860bb7f263e253fa649925296741b94c4e752b /generic/tclUtf.c
parent96bf5f215990235e4c0aa28930d25a4d16cdae32 (diff)
downloadtcl-8bccfa351c587aaf7e5d6aa27b0ef0141806c1cf.zip
tcl-8bccfa351c587aaf7e5d6aa27b0ef0141806c1cf.tar.gz
tcl-8bccfa351c587aaf7e5d6aa27b0ef0141806c1cf.tar.bz2
Fixed problem with [string compare \x00 \x01] and hopefully sped the
command up in a few cases too (notably byte arrays and UNICODE objects.) [Bug #219201]
Diffstat (limited to 'generic/tclUtf.c')
-rw-r--r--generic/tclUtf.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/generic/tclUtf.c b/generic/tclUtf.c
index b11fd85..2a6c217 100644
--- a/generic/tclUtf.c
+++ b/generic/tclUtf.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclUtf.c,v 1.14 2000/06/05 23:36:21 ericm Exp $
+ * RCS: @(#) $Id: tclUtf.c,v 1.15 2001/04/06 10:50:00 dkf Exp $
*/
#include "tclInt.h"
@@ -1087,11 +1087,9 @@ Tcl_UtfNcmp(cs, ct, n)
{
Tcl_UniChar ch1, ch2;
/*
- * Another approach that should work is:
- * return memcmp(cs, ct, (unsigned) (Tcl_UtfAtIndex(cs, n) - cs));
- * That assumes that ct is a properly formed UTF, so we will just
- * be comparing the bytes that compromise those strings to the
- * char length n.
+ * Cannot use memcmp()-based approach as byte representation of
+ * \u0000 (the pair of bytes 0xc0,0x80) is larger than byte
+ * representation of \u0001 (the byte 0x01.)
*/
while (n-- > 0) {
/*