diff options
author | hobbs <hobbs@noemail.net> | 2001-09-13 19:31:04 (GMT) |
---|---|---|
committer | hobbs <hobbs@noemail.net> | 2001-09-13 19:31:04 (GMT) |
commit | d1cd5250e66a3e8f0c74a9479e92b71729ec59dc (patch) | |
tree | 3dc255b80f2c3c3c754bbd15ac9434e812fdf084 | |
parent | d88fa7e0762b9f9b3e0ba8ba0c1754a4e5a775f7 (diff) | |
download | tcl-d1cd5250e66a3e8f0c74a9479e92b71729ec59dc.zip tcl-d1cd5250e66a3e8f0c74a9479e92b71729ec59dc.tar.gz tcl-d1cd5250e66a3e8f0c74a9479e92b71729ec59dc.tar.bz2 |
* generic/tclUtf.c (Tcl_UtfPrev): corrected to return the proper
location when the middle of a UTF-8 byte was passed in.
[Bug #450504]
FossilOrigin-Name: 5f02e9a154f7f71ebbdde2b10e380cc5c505fb2d
-rw-r--r-- | generic/tclUtf.c | 8 |
1 files 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--; |