summaryrefslogtreecommitdiffstats
path: root/generic/tclZipfs.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2018-10-12 18:44:25 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2018-10-12 18:44:25 (GMT)
commitde2192ab2097c8b53fd997775bbd1b74b4e8b8f0 (patch)
treee4631b773cc39676ec094c731878237340bb284c /generic/tclZipfs.c
parent7fcc213b7aa1313c6bbe4ee2f794913e6776b0db (diff)
downloadtcl-de2192ab2097c8b53fd997775bbd1b74b4e8b8f0.zip
tcl-de2192ab2097c8b53fd997775bbd1b74b4e8b8f0.tar.gz
tcl-de2192ab2097c8b53fd997775bbd1b74b4e8b8f0.tar.bz2
Turn [zipfs tcl_library] into more internal [tcl::zipfs::tcl_library_init]. It wasn't documented and isn't very useful outside of Tcl's startup code.
Diffstat (limited to 'generic/tclZipfs.c')
-rw-r--r--generic/tclZipfs.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c
index bd2ae13..428be15 100644
--- a/generic/tclZipfs.c
+++ b/generic/tclZipfs.c
@@ -3257,8 +3257,10 @@ TclZipfs_TclLibrary(void)
*
* ZipFSTclLibraryObjCmd --
*
- * This procedure is invoked to process the [zipfs tcl_library] command.
- * It returns the root that Tcl's library files are mounted under.
+ * This procedure is invoked to process the
+ * [::tcl::zipfs::tcl_library_init] command, usually called during the
+ * execution of Tcl's interpreter startup. It returns the root that Tcl's
+ * library files are mounted under.
*
* Results:
* A standard Tcl result.
@@ -3277,12 +3279,14 @@ ZipFSTclLibraryObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- Tcl_Obj *pResult = TclZipfs_TclLibrary();
+ if (!Tcl_IsSafe(interp)) {
+ Tcl_Obj *pResult = TclZipfs_TclLibrary();
- if (!pResult) {
- pResult = Tcl_NewObj();
+ if (!pResult) {
+ pResult = Tcl_NewObj();
+ }
+ Tcl_SetObjResult(interp, pResult);
}
- Tcl_SetObjResult(interp, pResult);
return TCL_OK;
}
@@ -4719,7 +4723,6 @@ TclZipfs_Init(
{"list", ZipFSListObjCmd, NULL, NULL, NULL, 0},
{"canonical", ZipFSCanonicalObjCmd, NULL, NULL, NULL, 0},
{"root", ZipFSRootObjCmd, NULL, NULL, NULL, 0},
- {"tcl_library", ZipFSTclLibraryObjCmd, NULL, NULL, NULL, 1},
{NULL, NULL, NULL, NULL, NULL, 0}
};
static const char findproc[] =
@@ -4769,6 +4772,8 @@ TclZipfs_Init(
Tcl_GetEnsembleMappingDict(NULL, ensemble, &mapObj);
Tcl_DictObjPut(NULL, mapObj, Tcl_NewStringObj("find", -1),
Tcl_NewStringObj("::tcl::zipfs::find", -1));
+ Tcl_CreateObjCommand(interp, "::tcl::zipfs::tcl_library_init",
+ ZipFSTclLibraryObjCmd, NULL, NULL);
Tcl_PkgProvide(interp, "zipfs", "2.0");
}
return TCL_OK;