diff options
author | ericm <ericm@noemail.net> | 2000-01-27 19:48:29 (GMT) |
---|---|---|
committer | ericm <ericm@noemail.net> | 2000-01-27 19:48:29 (GMT) |
commit | 162f3ad71c72fee1cc48978f8d6bce27099c2e8e (patch) | |
tree | 24c3203693a2642f3a3c42276897974f14712b60 /library/package.tcl | |
parent | d2f50b9d117c4cc7d53032b4ca35ed8ae2372c42 (diff) | |
download | tcl-162f3ad71c72fee1cc48978f8d6bce27099c2e8e.zip tcl-162f3ad71c72fee1cc48978f8d6bce27099c2e8e.tar.gz tcl-162f3ad71c72fee1cc48978f8d6bce27099c2e8e.tar.bz2 |
* tests/pkg/samename.tcl: test file for bug #1983
* tests/pkgMkIndex.test:
* library/package.tcl:
Fixed bug #1983, dealing with pkg_mkIndex incorrectly handling
situations with two procs by the same name but in different
namespaces (ie, foo::baz and bar::baz).
FossilOrigin-Name: 356f51f836eb82551fac028035d0108378d15c3e
Diffstat (limited to 'library/package.tcl')
-rw-r--r-- | library/package.tcl | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/library/package.tcl b/library/package.tcl index 6bf7ff1..f0f9f44 100644 --- a/library/package.tcl +++ b/library/package.tcl @@ -3,7 +3,7 @@ # utility procs formerly in init.tcl which can be loaded on demand # for package management. # -# RCS: @(#) $Id: package.tcl,v 1.7 2000/01/27 19:20:05 ericm Exp $ +# RCS: @(#) $Id: package.tcl,v 1.8 2000/01/27 19:48:29 ericm Exp $ # # Copyright (c) 1991-1993 The Regents of the University of California. # Copyright (c) 1994-1998 Sun Microsystems, Inc. @@ -285,31 +285,31 @@ proc pkg_mkIndex {args} { if {! [info exists ::tcl::namespaces($::tcl::x)]} { namespace import -force ${::tcl::x}::* } - } - - # Figure out what commands appeared - - foreach ::tcl::x [info commands] { - set ::tcl::newCmds($::tcl::x) 1 - } - foreach ::tcl::x $::tcl::origCmds { - catch {unset ::tcl::newCmds($::tcl::x)} - } - foreach ::tcl::x [array names ::tcl::newCmds] { - # reverse engineer which namespace a command comes from - - set ::tcl::abs [namespace origin $::tcl::x] - - # special case so that global names have no leading - # ::, this is required by the unknown command - - set ::tcl::abs [auto_qualify $::tcl::abs ::] - - if {[string compare $::tcl::x $::tcl::abs]} { - # Name changed during qualification - set ::tcl::newCmds($::tcl::abs) 1 - unset ::tcl::newCmds($::tcl::x) + # Figure out what commands appeared + + foreach ::tcl::x [info commands] { + set ::tcl::newCmds($::tcl::x) 1 + } + foreach ::tcl::x $::tcl::origCmds { + catch {unset ::tcl::newCmds($::tcl::x)} + } + foreach ::tcl::x [array names ::tcl::newCmds] { + # determine which namespace a command comes from + + set ::tcl::abs [namespace origin $::tcl::x] + + # special case so that global names have no leading + # ::, this is required by the unknown command + + set ::tcl::abs [auto_qualify $::tcl::abs ::] + + if {[string compare $::tcl::x $::tcl::abs]} { + # Name changed during qualification + + set ::tcl::newCmds($::tcl::abs) 1 + unset ::tcl::newCmds($::tcl::x) + } } } } |