summaryrefslogtreecommitdiffstats
path: root/library/auto.tcl
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2005-01-25 17:58:38 (GMT)
committerdgp <dgp@users.sourceforge.net>2005-01-25 17:58:38 (GMT)
commit9dbc38faed5d13bbc3656501c291dbda19ff86e7 (patch)
tree5a0bce04d79e0e84e65326ab3a671872c648e640 /library/auto.tcl
parentb8cca4b689b37496808c9a8ab25d09ef88e42e52 (diff)
downloadtcl-9dbc38faed5d13bbc3656501c291dbda19ff86e7.zip
tcl-9dbc38faed5d13bbc3656501c291dbda19ff86e7.tar.gz
tcl-9dbc38faed5d13bbc3656501c291dbda19ff86e7.tar.bz2
* library/auto.tcl: Updated [auto_reset] to clear auto-loaded
procs in namespaces other than :: [Bug 1101670].
Diffstat (limited to 'library/auto.tcl')
-rw-r--r--library/auto.tcl31
1 files changed, 16 insertions, 15 deletions
diff --git a/library/auto.tcl b/library/auto.tcl
index 276a4aa..e2b503e 100644
--- a/library/auto.tcl
+++ b/library/auto.tcl
@@ -3,7 +3,7 @@
# utility procs formerly in init.tcl dealing with auto execution
# of commands and can be auto loaded themselves.
#
-# RCS: @(#) $Id: auto.tcl,v 1.12.2.3 2004/12/01 22:07:57 dgp Exp $
+# RCS: @(#) $Id: auto.tcl,v 1.12.2.4 2005/01/25 17:58:44 dgp Exp $
#
# Copyright (c) 1991-1993 The Regents of the University of California.
# Copyright (c) 1994-1998 Sun Microsystems, Inc.
@@ -16,26 +16,27 @@
#
# Destroy all cached information for auto-loading and auto-execution,
# so that the information gets recomputed the next time it's needed.
-# Also delete any procedures that are listed in the auto-load index
-# except those defined in this file.
+# Also delete any procedures that are listed in the auto-load index,
+# except some of those defined in the Tcl script library.
#
# Arguments:
# None.
proc auto_reset {} {
- global auto_execs auto_index auto_oldpath
- foreach p [info procs] {
- if {[info exists auto_index($p)] && ![string match auto_* $p]
- && ([lsearch -exact {unknown pkg_mkIndex tclPkgSetup
- tcl_findLibrary pkg_compareExtension
- tclPkgUnknown tcl::MacOSXPkgUnknown
- tcl::MacPkgUnknown} $p] < 0)} {
- rename $p {}
- }
+ if {[array exists ::auto_index]} {
+ foreach cmdName [array names ::auto_index] {
+ if {[string match auto_* $cmdName]} {continue}
+ set fqcn [namespace which $cmdName]
+ if {$fqcn eq ""} {continue}
+ if {[catch {info args $fqcn}]} {continue}
+ if {[lsearch -exact {
+ ::unknown ::pkg_mkIndex ::tclPkgSetup ::tcl_findLibrary
+ ::pkg_compareExtension ::tclPkgUnknown ::tcl::MacOSXPkgUnknown
+ ::tcl::MacPkgUnknown} $fqcn] != -1)} {continue}
+ rename $fqcn {}
+ }
}
- catch {unset auto_execs}
- catch {unset auto_index}
- catch {unset auto_oldpath}
+ unset -nocomplain ::auto_execs ::auto_index ::auto_oldpath
}
# tcl_findLibrary --