diff options
author | dgp <dgp@users.sourceforge.net> | 2005-01-25 17:58:38 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2005-01-25 17:58:38 (GMT) |
commit | c0f3c8d011f53f572901f85abc0d63f0ef52040f (patch) | |
tree | 5a0bce04d79e0e84e65326ab3a671872c648e640 /library | |
parent | b720ee5317baebebef1cf9097f1660fdbbbfb759 (diff) | |
download | tcl-c0f3c8d011f53f572901f85abc0d63f0ef52040f.zip tcl-c0f3c8d011f53f572901f85abc0d63f0ef52040f.tar.gz tcl-c0f3c8d011f53f572901f85abc0d63f0ef52040f.tar.bz2 |
* library/auto.tcl: Updated [auto_reset] to clear auto-loaded
procs in namespaces other than :: [Bug 1101670].
Diffstat (limited to 'library')
-rw-r--r-- | library/auto.tcl | 31 |
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 -- |