summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2021-04-13 11:51:16 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2021-04-13 11:51:16 (GMT)
commitc89d776dce9bbd80c7a47b9778d85de6a9b7df66 (patch)
treee484a8e51b7213fce36cd62fd8102b687cd13fb2 /generic
parentb1e4f0fa23663a2ced0099c6d2d0bdb4ff286523 (diff)
downloadtcl-c89d776dce9bbd80c7a47b9778d85de6a9b7df66.zip
tcl-c89d776dce9bbd80c7a47b9778d85de6a9b7df66.tar.gz
tcl-c89d776dce9bbd80c7a47b9778d85de6a9b7df66.tar.bz2
Fix testcase utf-1.18
Diffstat (limited to 'generic')
-rw-r--r--generic/tclStringObj.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c
index 78a47e3..af72e13 100644
--- a/generic/tclStringObj.c
+++ b/generic/tclStringObj.c
@@ -70,8 +70,8 @@ static void SetUnicodeObj(Tcl_Obj *objPtr,
static int UnicodeLength(const Tcl_UniChar *unicode);
static void UpdateStringOfString(Tcl_Obj *objPtr);
-#define ISCONTINUATION(bytes) ((bytes) \
- && ((((bytes)[0] & 0xC0) == 0x80) || (((bytes)[0] == '\xED') \
+#define ISCONTINUATION(bytes) (\
+ ((((bytes)[0] & 0xC0) == 0x80) || (((bytes)[0] == '\xED') \
&& (((bytes)[1] & 0xF0) == 0xB0) && (((bytes)[2] & 0xC0) == 0x80))))
@@ -1225,7 +1225,7 @@ Tcl_AppendLimitedToObj(
/* If appended string starts with a continuation byte or a lower surrogate,
* force objPtr to unicode representation. See [7f1162a867] */
- if (ISCONTINUATION(bytes)) {
+ if (bytes && ISCONTINUATION(bytes)) {
Tcl_GetUnicode(objPtr);
}
if (stringPtr->hasUnicode && stringPtr->numChars > 0) {
@@ -1428,7 +1428,7 @@ Tcl_AppendObjToObj(
/* If appended string starts with a continuation byte or a lower surrogate,
* force objPtr to unicode representation. See [7f1162a867]
* This fixes append-3.4, append-3.7 and utf-1.18 testcases. */
- if (ISCONTINUATION(appendObjPtr->bytes)) {
+ if (ISCONTINUATION(TclGetString(appendObjPtr))) {
Tcl_GetUnicode(objPtr);
}
/*
@@ -3084,7 +3084,7 @@ TclStringCat(
*/
binary = 0;
- if (ov > objv+1 && ISCONTINUATION(objPtr->bytes)) {
+ if (ov > objv+1 && ISCONTINUATION(TclGetString(objPtr))) {
forceUniChar = 1;
} else if ((objPtr->typePtr) && (objPtr->typePtr != &tclStringType)) {
/* Prevent shimmer of non-string types. */