Skip to content

Commit

Permalink
Now that the robust, early method of directing Tcl to find its script
Browse files Browse the repository at this point in the history
library in the zipfs archive is in place, we can yank out the hacky approach
of defining a semi-secret command to extend a search path.
  • Loading branch information
dgp committed Nov 13, 2023
1 parent 4c391a1 commit b5b660a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 41 deletions.
1 change: 0 additions & 1 deletion generic/tclInterp.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,6 @@ Tcl_Init(
"if {$tail eq [info tclversion]} continue\n"
"file join [file dirname $env(TCL_LIBRARY)] tcl[info tclversion]}\n"
" }\n"
" lappend scripts {::tcl::zipfs::tcl_library_init}\n"
" if {[info exists tclDefaultLibrary]} {\n"
" lappend scripts {set tclDefaultLibrary}\n"
" } else {\n"
Expand Down
40 changes: 0 additions & 40 deletions generic/tclZipfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -4353,44 +4353,6 @@ TclZipfs_TclLibrary(void)
return NULL;
}

/*
*-------------------------------------------------------------------------
*
* ZipFSTclLibraryObjCmd --
*
* 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.
*
* Side effects:
* May initialise the cache of where such library files are to be found.
* This cache is never cleared.
*
*-------------------------------------------------------------------------
*/

static int
ZipFSTclLibraryObjCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp, /* Current interpreter. */
TCL_UNUSED(int) /*objc*/,
TCL_UNUSED(Tcl_Obj *const *)) /*objv*/
{
if (!Tcl_IsSafe(interp)) {
Tcl_Obj *pResult = TclZipfs_TclLibrary();

if (!pResult) {
TclNewObj(pResult);
}
Tcl_SetObjResult(interp, pResult);
}
return TCL_OK;
}

/*
*-------------------------------------------------------------------------
*
Expand Down Expand Up @@ -6286,8 +6248,6 @@ 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, "tcl::zipfs", "2.0");
}
return TCL_OK;
Expand Down

0 comments on commit b5b660a

Please sign in to comment.