summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2021-04-16 13:52:23 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2021-04-16 13:52:23 (GMT)
commit8f798085ffe0484daaa29b244d4f1daffccfa15b (patch)
tree6eab28bce35efd3f1d3d3f2f059335019048f657
parent8ba69750a3d5b3706fb03205f59a64e6c7539663 (diff)
parent869ea625f19c8db04df71882da99ce56b3198fb2 (diff)
downloadtcl-8f798085ffe0484daaa29b244d4f1daffccfa15b.zip
tcl-8f798085ffe0484daaa29b244d4f1daffccfa15b.tar.gz
tcl-8f798085ffe0484daaa29b244d4f1daffccfa15b.tar.bz2
Merge 9.0
-rw-r--r--doc/Alloc.39
-rw-r--r--doc/Init.312
-rw-r--r--doc/Tcl_Main.315
-rw-r--r--generic/tclUtil.c9
-rw-r--r--tests/util.test3
-rw-r--r--win/tclWinFile.c1
6 files changed, 34 insertions, 15 deletions
diff --git a/doc/Alloc.3 b/doc/Alloc.3
index c3c3f11..c0fd0cd 100644
--- a/doc/Alloc.3
+++ b/doc/Alloc.3
@@ -74,9 +74,12 @@ the procedures \fBTcl_Alloc\fR, \fBTcl_Free\fR, \fBTcl_Realloc\fR,
\fBTcl_AttemptAlloc\fR, and \fBTcl_AttempRealloc\fR are implemented
as macros, redefined to be special debugging versions of these procedures.
-\fBTcl_GetMemoryInfo\fR appends a list-of-lists of memory stats to the provided DString.
-This procedure may be called when the TCL library is included within an embedded application.
-The stubs table must be first initialized using one of \fBTcl_InitSubsystems\fR, \fBTcl_SetPanicProc\fR, \fBTcl_FindExecutable\fR or \fBTclZipfs_AppHook\fR.
+\fBTcl_GetMemoryInfo\fR appends a list-of-lists of memory stats to the
+provided DString. This function cannot be used in stub-enabled extensions,
+and it is only available if Tcl is compiled with the threaded memory allocator
+When used in stub-enabled embedders, the stubs table must be first initialized
+using one of \fBTcl_InitSubsystems\fR, \fBTcl_SetPanicProc\fR,
+\fBTcl_FindExecutable\fR or \fBTclZipfs_AppHook\fR.
.SH KEYWORDS
alloc, allocation, free, malloc, memory, realloc, TCL_MEM_DEBUG
diff --git a/doc/Init.3 b/doc/Init.3
index fa87892..e109c82 100644
--- a/doc/Init.3
+++ b/doc/Init.3
@@ -32,12 +32,16 @@ path.
.PP
\fBTcl_Init\fR is typically called from \fBTcl_AppInit\fR procedures.
.PP
-\fBTcl_SetPreInitScript\fR registeres the pre-initialization script and returns the former (now replaced) script pointer.
+\fBTcl_SetPreInitScript\fR registers the pre-initialization script and
+returns the former (now replaced) script pointer.
A value of \fINULL\fR may be passed to not register any script.
-The pre-initialization script is executed by \fBTcl_Init\fR before accessing the file system.
-The purpose is to typically prepare a custom file system (like an embedded zip-file) to be activated before the search.
+The pre-initialization script is executed by \fBTcl_Init\fR before accessing
+the file system. The purpose is to typically prepare a custom file system
+(like an embedded zip-file) to be activated before the search.
-When the TCL library is loaded within an embedded application, the stubs table must be first initialized using one of \fBTcl_InitSubsystems\fR, \fBTcl_SetPanicProc\fR, \fBTcl_FindExecutable\fR or \fBTclZipfs_AppHook\fR before \fBTcl_SetPreInitScript\fR may be called.
+When used in stub-enabled embedders, the stubs table must be first initialized
+using one of \fBTcl_InitSubsystems\fR, \fBTcl_SetPanicProc\fR, \fBTcl_FindExecutable\fR
+or \fBTclZipfs_AppHook\fR before \fBTcl_SetPreInitScript\fR may be called.
.SH "SEE ALSO"
Tcl_AppInit, Tcl_Main
diff --git a/doc/Tcl_Main.3 b/doc/Tcl_Main.3
index 6ace8c9..b7b15a9 100644
--- a/doc/Tcl_Main.3
+++ b/doc/Tcl_Main.3
@@ -10,16 +10,16 @@
.so man.macros
.BS
.SH NAME
-Tcl_Main, Tcl_SetStartupScript, Tcl_GetStartupScript, Tcl_SetMainLoop \- main program, startup script, and event loop definition for Tcl-based applications
+Tcl_Main, Tcl_MainEx, Tcl_MainExW, Tcl_SetStartupScript, Tcl_GetStartupScript, Tcl_SetMainLoop \- main program, startup script, and event loop definition for Tcl-based applications
.SH SYNOPSIS
.nf
\fB#include <tcl.h>\fR
.sp
\fBTcl_Main\fR(\fIargc, argv, appInitProc\fR)
.sp
-\fBTcl_MainEx\fR(\fIargc, charargv, appInitProc\fR)
+\fBTcl_MainEx\fR(\fIargc, charargv, appInitProc, interp\fR)
.sp
-\fBTcl_MainExW\fR(\fIargc, wideargv, appInitProc\fR)
+\fBTcl_MainExW\fR(\fIargc, wideargv, appInitProc, interp\fR)
.sp
\fBTcl_SetStartupScript\fR(\fIpath, encoding\fR)
.sp
@@ -50,6 +50,8 @@ If non-NULL, location to write a copy of the (const char *)
pointing to the encoding name.
.AP Tcl_MainLoopProc *mainLoopProc in
Address of an application-specific event loop procedure.
+.AP Tcl_Interp *interp in
+Already created Tcl Interpreter.
.BE
.SH DESCRIPTION
.PP
@@ -200,9 +202,10 @@ the \fBexit\fR command.
.PP
\fBTcl_Main\fR can not be used in stub-enabled extensions.
.PP
-When the TCL library is loaded within an embedded application, \fBTcl_MainEx\fR or \fBTcl_MainExW\fR may be used to call \fBTcl_Main\fR.
-The difference between Tcl_MainEx and Tcl_MainExW is that the arguments are passed as characters or wide characters.
-Remark that the stubs table must be first initialized using one of \fBTcl_InitSubsystems\fR, \fBTcl_SetPanicProc\fR, \fBTcl_FindExecutable\fR or \fBTclZipfs_AppHook\fR.
+The difference between Tcl_MainEx and Tcl_MainExW is that the arguments
+are passed as characters or wide characters. When used in stub-enabled
+embedders, the stubs table must be first initialized using one of
+\fBTcl_InitSubsystems\fR, \fBTcl_SetPanicProc\fR, \fBTcl_FindExecutable\fR or \fBTclZipfs_AppHook\fR.
.SH "SEE ALSO"
tclsh(1), Tcl_GetStdChannel(3), Tcl_StandardChannels(3), Tcl_AppInit(3),
exit(n), encoding(n)
diff --git a/generic/tclUtil.c b/generic/tclUtil.c
index c9c3b8f..9b44870 100644
--- a/generic/tclUtil.c
+++ b/generic/tclUtil.c
@@ -1969,7 +1969,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 385896e..ec79336 100644
--- a/tests/util.test
+++ b/tests/util.test
@@ -212,6 +212,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
diff --git a/win/tclWinFile.c b/win/tclWinFile.c
index e4dd665..f2e3488 100644
--- a/win/tclWinFile.c
+++ b/win/tclWinFile.c
@@ -1875,7 +1875,6 @@ NativeIsExec(
if ((_wcsicmp(path, L"exe") == 0)
|| (_wcsicmp(path, L"com") == 0)
|| (_wcsicmp(path, L"cmd") == 0)
- || (_wcsicmp(path, L"cmd") == 0)
|| (_wcsicmp(path, L"bat") == 0)) {
return 1;
}