From ed76bc73e40aa30cd6d94b32c71b533e87a52387 Mon Sep 17 00:00:00 2001 From: hobbs Date: Thu, 13 Sep 2001 19:31:04 +0000 Subject: * generic/tclUtf.c (Tcl_UtfPrev): corrected to return the proper location when the middle of a UTF-8 byte was passed in. [Bug #450504] --- generic/tclUtf.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/generic/tclUtf.c b/generic/tclUtf.c index 8b39d5f..66c89a2 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.16 2001/06/28 01:10:15 hobbs Exp $ + * RCS: @(#) $Id: tclUtf.c,v 1.17 2001/09/13 19:31:04 hobbs Exp $ */ #include "tclInt.h" @@ -634,7 +634,8 @@ Tcl_UtfNext(str) * Tcl_UtfPrev -- * * Given a pointer to some current location in a UTF-8 string, - * move backwards one character. + * move backwards one character. This works correctly when the + * pointer is in the middle of a UTF-8 character. * * Results: * The return value is a pointer to the previous character in the @@ -672,9 +673,6 @@ Tcl_UtfPrev(str, start) break; } if (byte >= 0xC0) { - if (totalBytes[byte] != i + 1) { - break; - } return (char *) look; } look--; -- cgit v0.12