diff options
| author | donal.k.fellows@manchester.ac.uk <dkf> | 2001-04-06 10:50:00 (GMT) |
|---|---|---|
| committer | donal.k.fellows@manchester.ac.uk <dkf> | 2001-04-06 10:50:00 (GMT) |
| commit | 9f32b2c3ff34e5dcd7a8c0d62a803a638482e35c (patch) | |
| tree | 81860bb7f263e253fa649925296741b94c4e752b /generic/tclUtf.c | |
| parent | f91e09bb914ffd1164244d818dff5f8fb7ae060d (diff) | |
| download | tcl-9f32b2c3ff34e5dcd7a8c0d62a803a638482e35c.zip tcl-9f32b2c3ff34e5dcd7a8c0d62a803a638482e35c.tar.gz tcl-9f32b2c3ff34e5dcd7a8c0d62a803a638482e35c.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.c | 10 |
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) { /* |
