diff options
author | dgp <dgp@noemail.net> | 2003-03-06 23:27:12 (GMT) |
---|---|---|
committer | dgp <dgp@noemail.net> | 2003-03-06 23:27:12 (GMT) |
commit | 83dc55c2178dbf7292f5c2d698cba779422eff27 (patch) | |
tree | b1a72619f7dd43be739320a272719b7c91030da7 /generic/tclUtf.c | |
parent | f6e59d06f01c1b3eec1fb5b3086607c027eaa364 (diff) | |
download | tcl-83dc55c2178dbf7292f5c2d698cba779422eff27.zip tcl-83dc55c2178dbf7292f5c2d698cba779422eff27.tar.gz tcl-83dc55c2178dbf7292f5c2d698cba779422eff27.tar.bz2 |
* generic/TclUtf.c (Tcl_UniCharNcasecmp): Corrected failure to
* tests/utf.test (utf-25.*): properly compare Unicode strings of
different case in a case insensitive manner. [Bug 699042]
FossilOrigin-Name: a7fde7d55a48e8454fe7a8147d509dd9c4df8329
Diffstat (limited to 'generic/tclUtf.c')
-rw-r--r-- | generic/tclUtf.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/generic/tclUtf.c b/generic/tclUtf.c index 6c6835c..2e464ed 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.30 2003/02/18 02:25:45 hobbs Exp $ + * RCS: @(#) $Id: tclUtf.c,v 1.31 2003/03/06 23:27:14 dgp Exp $ */ #include "tclInt.h" @@ -1294,9 +1294,12 @@ Tcl_UniCharNcasecmp(cs, ct, n) unsigned long n; /* Number of unichars to compare. */ { for ( ; n != 0; n--, cs++, ct++) { - if ((*cs != *ct) && - (Tcl_UniCharToLower(*cs) != Tcl_UniCharToLower(*ct))) { - return (*cs - *ct); + if (*cs != *ct) { + Tcl_UniChar lcs = Tcl_UniCharToLower(*cs); + Tcl_UniChar lct = Tcl_UniCharToLower(*ct); + if (lcs != lct) { + return (lcs - lct); + } } } return 0; |