summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2023-09-12 19:38:38 (GMT)
committerdgp <dgp@users.sourceforge.net>2023-09-12 19:38:38 (GMT)
commit6e62967ee57a8ce0b804a5e6d103659722d56283 (patch)
tree305ea6f466d9fb5074d5131afef5de58931c557e
parent03b067073f91c9f11e8759274ed179bdd2514ba5 (diff)
downloadtcl-6e62967ee57a8ce0b804a5e6d103659722d56283.zip
tcl-6e62967ee57a8ce0b804a5e6d103659722d56283.tar.gz
tcl-6e62967ee57a8ce0b804a5e6d103659722d56283.tar.bz2
TIP 624 followup. Now TclMakeSafe can be a static routine.
-rw-r--r--generic/tclInt.h1
-rw-r--r--generic/tclInterp.c13
2 files changed, 5 insertions, 9 deletions
diff --git a/generic/tclInt.h b/generic/tclInt.h
index 65dcb4a..38d628a 100644
--- a/generic/tclInt.h
+++ b/generic/tclInt.h
@@ -3398,7 +3398,6 @@ MODULE_SCOPE Tcl_Obj * TclLsetFlat(Tcl_Interp *interp, Tcl_Obj *listPtr,
Tcl_Obj *valuePtr);
MODULE_SCOPE Tcl_Command TclMakeEnsemble(Tcl_Interp *interp, const char *name,
const EnsembleImplMap map[]);
-MODULE_SCOPE int TclMakeSafe(Tcl_Interp *interp);
MODULE_SCOPE Tcl_Size TclMaxListLength(const char *bytes, Tcl_Size numBytes,
const char **endPtr);
MODULE_SCOPE int TclMergeReturnOptions(Tcl_Interp *interp, int objc,
diff --git a/generic/tclInterp.c b/generic/tclInterp.c
index bd79497..6e08bd7 100644
--- a/generic/tclInterp.c
+++ b/generic/tclInterp.c
@@ -268,6 +268,7 @@ static void SetScriptLimitCallback(Tcl_Interp *interp, int type,
static void CallScriptLimitCallback(void *clientData,
Tcl_Interp *interp);
static void DeleteScriptLimitCallback(void *clientData);
+static void MakeSafe(Tcl_Interp *interp);
static void RunLimitHandlers(LimitHandler *handlerPtr,
Tcl_Interp *interp);
static void TimeLimitCallback(void *clientData);
@@ -2481,9 +2482,7 @@ ChildCreate(
((Interp *) parentInterp)->maxNestingDepth;
if (safe) {
- if (TclMakeSafe(childInterp) == TCL_ERROR) {
- goto error;
- }
+ MakeSafe(childInterp);
} else {
if (Tcl_Init(childInterp) == TCL_ERROR) {
goto error;
@@ -3264,7 +3263,7 @@ Tcl_IsSafe(
/*
*----------------------------------------------------------------------
*
- * TclMakeSafe --
+ * MakeSafe --
*
* Makes its argument interpreter contain only functionality that is
* defined to be part of Safe Tcl. Unsafe commands are hidden, the env
@@ -3280,8 +3279,8 @@ Tcl_IsSafe(
*----------------------------------------------------------------------
*/
-int
-TclMakeSafe(
+void
+MakeSafe(
Tcl_Interp *interp) /* Interpreter to be made safe. */
{
Tcl_Channel chan; /* Channel to remove from safe interpreter. */
@@ -3355,8 +3354,6 @@ TclMakeSafe(
if (chan != NULL) {
Tcl_UnregisterChannel(interp, chan);
}
-
- return TCL_OK;
}
/*