summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2023-07-05 15:08:38 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2023-07-05 15:08:38 (GMT)
commita2e7501d7439560bede0964137faae67e9ebfc9a (patch)
tree78259ddbb5a7c753df13109be0f9142abdf14e50
parent0109dc8279103bead1cf16cc465c20bd190847b7 (diff)
parent575f580d51fd5cecec6f1910056e647281fc0851 (diff)
downloadtcl-a2e7501d7439560bede0964137faae67e9ebfc9a.zip
tcl-a2e7501d7439560bede0964137faae67e9ebfc9a.tar.gz
tcl-a2e7501d7439560bede0964137faae67e9ebfc9a.tar.bz2
Merge 8.6
-rw-r--r--generic/tclEncoding.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c
index 405c179..539b520 100644
--- a/generic/tclEncoding.c
+++ b/generic/tclEncoding.c
@@ -564,8 +564,8 @@ TclInitEncodingSubsystem(void)
unsigned size;
unsigned short i;
union {
- char c;
- short s;
+ char c;
+ short s;
} isLe;
int leFlags;
@@ -3399,9 +3399,9 @@ TableToUtfProc(
byte = *((unsigned char *) src);
if (prefixBytes[byte]) {
if (src >= srcEnd-1) {
- /* Prefix byte but nothing after it */
+ /* Prefix byte but nothing after it */
if (!(flags & TCL_ENCODING_END)) {
- /* More data to come */
+ /* More data to come */
result = TCL_CONVERT_MULTIBYTE;
break;
} else if (PROFILE_STRICT(flags)) {
@@ -3410,17 +3410,16 @@ TableToUtfProc(
} else if (PROFILE_REPLACE(flags)) {
ch = UNICODE_REPLACE_CHAR;
} else {
- ch = (unsigned) byte;
+ ch = (Tcl_UniChar)byte;
}
} else {
- ++src;
- ch = toUnicode[byte][*((unsigned char *)src)];
+ ch = toUnicode[byte][*((unsigned char *)++src)];
}
} else {
ch = pageZero[byte];
}
if ((ch == 0) && (byte != 0)) {
- /* Prefix+suffix pair is invalid */
+ /* Prefix+suffix pair is invalid */
if (PROFILE_STRICT(flags)) {
result = TCL_CONVERT_SYNTAX;
break;
@@ -3431,7 +3430,7 @@ TableToUtfProc(
if (PROFILE_REPLACE(flags)) {
ch = UNICODE_REPLACE_CHAR;
} else {
- ch = (Tcl_UniChar)byte;
+ ch = (Tcl_UniChar)byte;
}
}