summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2021-04-14 18:58:54 (GMT)
committerdgp <dgp@users.sourceforge.net>2021-04-14 18:58:54 (GMT)
commit9cb33ddcc542ff8855a3892170d61ec1375567e4 (patch)
treeeec6cd33de783d6dbcdf6b3d00ade7d020995258
parent0b6db319f0ee6a542c2d1ad6f46b587211f882d2 (diff)
parentc942ef369bab61550b2904337f031f958da3b28e (diff)
downloadtcl-9cb33ddcc542ff8855a3892170d61ec1375567e4.zip
tcl-9cb33ddcc542ff8855a3892170d61ec1375567e4.tar.gz
tcl-9cb33ddcc542ff8855a3892170d61ec1375567e4.tar.bz2
merge 8.5; adapt fix for 8.6
-rw-r--r--generic/tclUtil.c9
-rw-r--r--tests/util.test3
2 files changed, 11 insertions, 1 deletions
diff --git a/generic/tclUtil.c b/generic/tclUtil.c
index 450f3bf..9a0203e 100644
--- a/generic/tclUtil.c
+++ b/generic/tclUtil.c
@@ -2027,7 +2027,14 @@ Tcl_ConcatObj(
continue;
}
if (resPtr) {
- if (TCL_OK != Tcl_ListObjAppendList(NULL, resPtr, objPtr)) {
+ Tcl_Obj *elemPtr = NULL;
+
+ Tcl_ListObjIndex(NULL, objPtr, 0, &elemPtr);
+ if (elemPtr == NULL) {
+ continue;
+ }
+ if (Tcl_GetString(elemPtr)[0] == '#' || TCL_OK
+ != Tcl_ListObjAppendList(NULL, resPtr, objPtr)) {
/* Abandon ship! */
Tcl_DecrRefCount(resPtr);
goto slow;
diff --git a/tests/util.test b/tests/util.test
index 052e7d3..d0b98a5 100644
--- a/tests/util.test
+++ b/tests/util.test
@@ -211,6 +211,9 @@ test util-4.7 {Tcl_ConcatObj - refCount safety} testconcatobj {
# symptoms was Bug #2055782.
testconcatobj
} {}
+test util-4.8 {Tcl_ConcatObj - [Bug 26649439c7]} {
+ concat [list foo] [list #]
+} {foo {#}}
proc Wrapper_Tcl_StringMatch {pattern string} {
# Forces use of Tcl_StringMatch, not Tcl_UniCharCaseMatch