summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
Diffstat (limited to 'library')
-rw-r--r--library/init.tcl33
1 files changed, 17 insertions, 16 deletions
diff --git a/library/init.tcl b/library/init.tcl
index 8ad26f9..b1d2b09 100644
--- a/library/init.tcl
+++ b/library/init.tcl
@@ -3,7 +3,7 @@
# Default system startup file for Tcl-based applications. Defines
# "unknown" procedure and auto-load facilities.
#
-# RCS: @(#) $Id: init.tcl,v 1.55.2.1 2003/07/18 23:35:39 dgp Exp $
+# RCS: @(#) $Id: init.tcl,v 1.55.2.2 2003/09/23 04:49:12 dgp Exp $
#
# Copyright (c) 1991-1993 The Regents of the University of California.
# Copyright (c) 1994-1996 Sun Microsystems, Inc.
@@ -342,8 +342,17 @@ proc auto_load {cmd {namespace {}}} {
lappend nameList $cmd
foreach name $nameList {
if {[info exists auto_index($name)]} {
- uplevel #0 $auto_index($name)
- return [expr {[info commands $name] != ""}]
+ namespace eval :: $auto_index($name)
+ # There's a couple of ways to look for a command of a given
+ # name. One is to use
+ # info commands $name
+ # Unfortunately, if the name has glob-magic chars in it like *
+ # or [], it may not match. For our purposes here, a better
+ # route is to use
+ # namespace which -command $name
+ if {[namespace which -command $name] ne ""} {
+ return 1
+ }
}
}
if {![info exists auto_path]} {
@@ -355,15 +364,8 @@ proc auto_load {cmd {namespace {}}} {
}
foreach name $nameList {
if {[info exists auto_index($name)]} {
- uplevel #0 $auto_index($name)
- # There's a couple of ways to look for a command of a given
- # name. One is to use
- # info commands $name
- # Unfortunately, if the name has glob-magic chars in it like *
- # or [], it may not match. For our purposes here, a better
- # route is to use
- # namespace which -command $name
- if { ![string equal [namespace which -command $name] ""] } {
+ namespace eval :: $auto_index($name)
+ if {[namespace which -command $name] ne ""} {
return 1
}
}
@@ -516,10 +518,9 @@ proc auto_import {pattern} {
foreach pattern $patternList {
foreach name [array names auto_index $pattern] {
- if {[string equal "" [info commands $name]]
- && [string equal [namespace qualifiers $pattern] \
- [namespace qualifiers $name]]} {
- uplevel #0 $auto_index($name)
+ if {([namespace which -command $name] eq "")
+ && ([namespace qualifiers $pattern] eq [namespace qualifiers $name])} {
+ namespace eval :: $auto_index($name)
}
}
}