From 079a1bc35abbfedee3c3416098fdaee736d92d35 Mon Sep 17 00:00:00 2001 From: stanton Date: Wed, 2 Jun 1999 20:21:24 +0000 Subject: * generic/tclUtf.c (Tcl_UtfNcasecmp): Fixed incorrect computation of relative ordering. [Bug: 2135] --- generic/tclUtf.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/generic/tclUtf.c b/generic/tclUtf.c index 635ffbe..c2abdae 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.7 1999/05/22 01:20:13 stanton Exp $ + * RCS: @(#) $Id: tclUtf.c,v 1.8 1999/06/02 20:21:24 stanton Exp $ */ #include "tclInt.h" @@ -1133,9 +1133,12 @@ Tcl_UtfNcasecmp(cs, ct, n) */ cs += Tcl_UtfToUniChar(cs, &ch1); ct += Tcl_UtfToUniChar(ct, &ch2); - if ((ch1 != ch2) && - (Tcl_UniCharToLower(ch1) != Tcl_UniCharToLower(ch2))) { - return (ch1 - ch2); + if (ch1 != ch2) { + ch1 = Tcl_UniCharToLower(ch1); + ch2 = Tcl_UniCharToLower(ch2); + if (ch1 != ch2) { + return (ch1 - ch2); + } } } return 0; -- cgit v0.12