summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2024-01-22 15:43:22 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2024-01-22 15:43:22 (GMT)
commite3e97685c5828c76e204f0b03aa9167f57aa8bf1 (patch)
tree03c7e10928abfd63195d2d3e2e3f7337d123e791
parent9fc36886d65d9528baf88a93e59957a5b125b778 (diff)
parent954d7b33134d9e2aef219ae5c829e4062eaf1da8 (diff)
downloadtcl-e3e97685c5828c76e204f0b03aa9167f57aa8bf1.zip
tcl-e3e97685c5828c76e204f0b03aa9167f57aa8bf1.tar.gz
tcl-e3e97685c5828c76e204f0b03aa9167f57aa8bf1.tar.bz2
Merge 8.7
-rw-r--r--doc/StringObj.36
-rw-r--r--generic/regc_locale.c3
-rw-r--r--generic/tclIO.c2
-rw-r--r--generic/tclUtf.c8
4 files changed, 8 insertions, 11 deletions
diff --git a/doc/StringObj.3 b/doc/StringObj.3
index 826f80e..7e9e56b 100644
--- a/doc/StringObj.3
+++ b/doc/StringObj.3
@@ -213,12 +213,16 @@ to bytes) in the string value.
\fBTcl_AppendToObj\fR appends the data given by \fIbytes\fR and
\fIlength\fR to the string representation of the value specified by
\fIobjPtr\fR. If the value has an invalid string representation,
-then an attempt is made to convert \fIbytes\fR is to the Unicode
+then an attempt is made to convert \fIbytes\fR to the Unicode
format. If the conversion is successful, then the converted form of
\fIbytes\fR is appended to the value's Unicode representation.
Otherwise, the value's Unicode representation is invalidated and
converted to the UTF format, and \fIbytes\fR is appended to the
value's new string representation.
+\fIlength\fR bytes are allocated and not filled, if \fIbytes\fR is a
+null pointer.
+Eventually buffer growth is optimized by large allocations to optimize
+multiple calls.
.PP
\fBTcl_AppendUnicodeToObj\fR appends the Unicode string given by
\fIunicode\fR and \fInumChars\fR to the value specified by
diff --git a/generic/regc_locale.c b/generic/regc_locale.c
index 1500c69..c5ba880 100644
--- a/generic/regc_locale.c
+++ b/generic/regc_locale.c
@@ -302,8 +302,7 @@ static const crange controlRangeTable[] = {
{0x202A, 0x202E}, {0x2060, 0x2064}, {0x2066, 0x206F}, {0xE000, 0xF8FF},
{0xFFF9, 0xFFFB}
#if CHRBITS > 16
- ,{0x13430, 0x1343F}, {0x1BCA0, 0x1BCA3}, {0x1D173, 0x1D17A}, {0xE0020, 0xE007F},
- {0xF0000, 0xFFFFD}, {0x100000, 0x10FFFD}
+ ,{0x13430, 0x1343F}, {0x1BCA0, 0x1BCA3}, {0x1D173, 0x1D17A}, {0xE0020, 0xE007F}
#endif
};
diff --git a/generic/tclIO.c b/generic/tclIO.c
index 552cab5..b480377 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -6259,7 +6259,7 @@ ReadChars(
int dstLimit = TCL_UTF_MAX - 1 + toRead * factor / UTF_EXPANSION_FACTOR;
(void) Tcl_GetStringFromObj(objPtr, &numBytes);
- Tcl_SetObjLength(objPtr, numBytes + dstLimit);
+ Tcl_AppendToObj(objPtr, NULL, dstLimit);
if (toRead == srcLen) {
Tcl_Size size;
diff --git a/generic/tclUtf.c b/generic/tclUtf.c
index a59868a..ca4a166 100644
--- a/generic/tclUtf.c
+++ b/generic/tclUtf.c
@@ -2079,13 +2079,7 @@ Tcl_UniCharIsControl(
if (UNICODE_OUT_OF_RANGE(ch)) {
/* Clear away extension bits, if any */
ch &= 0x1FFFFF;
- if ((ch == 0xE0001) || ((ch >= 0xE0020) && (ch <= 0xE007F))) {
- return 1;
- }
- if ((ch >= 0xF0000) && ((ch & 0xFFFF) <= 0xFFFD)) {
- return 1;
- }
- return 0;
+ return ((ch == 0xE0001) || ((unsigned)(ch - 0xE0020) <= 0x5F));
}
return ((CONTROL_BITS >> GetCategory(ch)) & 1);
}