diff options
author | kjnash <k.j.nash@usa.net> | 2020-07-18 13:22:31 (GMT) |
---|---|---|
committer | kjnash <k.j.nash@usa.net> | 2020-07-18 13:22:31 (GMT) |
commit | 6310c709d39e30dcefc165aa242973e919d86134 (patch) | |
tree | 35ceb3975e94160fa8a29fedf0af6fd9068893a1 /library | |
parent | 690f2c283978a046e78664a1070c5c0bf5ddf67f (diff) | |
download | tcl-6310c709d39e30dcefc165aa242973e919d86134.zip tcl-6310c709d39e30dcefc165aa242973e919d86134.tar.gz tcl-6310c709d39e30dcefc165aa242973e919d86134.tar.bz2 |
Update comments about safe interpreters in library/tm.tcl and library/package.tcl so they agree with code
Diffstat (limited to 'library')
-rw-r--r-- | library/package.tcl | 10 | ||||
-rw-r--r-- | library/tm.tcl | 11 |
2 files changed, 13 insertions, 8 deletions
diff --git a/library/package.tcl b/library/package.tcl index 44e3b28..d6280ae 100644 --- a/library/package.tcl +++ b/library/package.tcl @@ -479,9 +479,12 @@ proc tclPkgUnknown {name args} { } set tclSeenPath($dir) 1 - # we can't use glob in safe interps, so enclose the following in a - # catch statement, where we get the pkgIndex files out of the - # subdirectories + # Get the pkgIndex.tcl files in subdirectories of auto_path directories. + # - Safe Base interpreters have a restricted "glob" command that + # works in this case. + # - The "catch" was essential when there was no safe glob and every + # call in a safe interp failed; it is retained only for corner + # cases in which the eventual call to glob returns an error. catch { foreach file [glob -directory $dir -join -nocomplain \ * pkgIndex.tcl] { @@ -585,6 +588,7 @@ proc tcl::MacOSXPkgUnknown {original name args} { set tclSeenPath($dir) 1 # get the pkgIndex files out of the subdirectories + # Safe interpreters do not use tcl::MacOSXPkgUnknown - see init.tcl. foreach file [glob -directory $dir -join -nocomplain \ * Resources Scripts pkgIndex.tcl] { set dir [file dirname $file] diff --git a/library/tm.tcl b/library/tm.tcl index 0ed3f1a..c60084c 100644 --- a/library/tm.tcl +++ b/library/tm.tcl @@ -212,11 +212,12 @@ proc ::tcl::tm::UnknownHandler {original name args} { } set strip [llength [file split $path]] - # We can't use glob in safe interps, so enclose the following in a - # catch statement, where we get the module files out of the - # subdirectories. In other words, Tcl Modules are not-functional - # in such an interpreter. This is the same as for the command - # "tclPkgUnknown", i.e. the search for regular packages. + # Get the module files out of the subdirectories. + # - Safe Base interpreters have a restricted "glob" command that + # works in this case. + # - The "catch" was essential when there was no safe glob and every + # call in a safe interp failed; it is retained only for corner + # cases in which the eventual call to glob returns an error. catch { # We always look for _all_ possible modules in the current |