summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorhobbs <hobbs>2001-09-13 19:31:04 (GMT)
committerhobbs <hobbs>2001-09-13 19:31:04 (GMT)
commited76bc73e40aa30cd6d94b32c71b533e87a52387 (patch)
tree3dc255b80f2c3c3c754bbd15ac9434e812fdf084 /generic
parentf85426b4e949d70a3456553f9229915e004143a9 (diff)
downloadtcl-ed76bc73e40aa30cd6d94b32c71b533e87a52387.zip
tcl-ed76bc73e40aa30cd6d94b32c71b533e87a52387.tar.gz
tcl-ed76bc73e40aa30cd6d94b32c71b533e87a52387.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]
Diffstat (limited to 'generic')
-rw-r--r--generic/tclUtf.c8
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--;