From: Jeff Hobbs Date: Wed, 3 Dec 2008 07:47:23 +0000 (+0000) Subject: * pkgIndex.tcl.in, library/tclprocvfs.tcl: vfs::ns bump to 0.5.1 X-Git-Tag: vfs-1-4~4 X-Git-Url: http://privyetmir.co.uk/gitweb.cgi?a=commitdiff_plain;h=63774edab233b3f3239ce261d09f5efffc94fc9f;p=tclvfs * pkgIndex.tcl.in, library/tclprocvfs.tcl: vfs::ns bump to 0.5.1 Correct glob of namespaces. [Bug 1280914] --- diff --git a/library/tclprocvfs.tcl b/library/tclprocvfs.tcl index 8bc0d51..85b792c 100644 --- a/library/tclprocvfs.tcl +++ b/library/tclprocvfs.tcl @@ -113,13 +113,15 @@ proc vfs::ns::matchindirectory {ns path actualpath pattern type} { ::vfs::log "matchindirectory $path $actualpath $pattern $type" set res [list] + set ns ::[string trim $ns :] + set nspath ${ns}::${path} if {[::vfs::matchDirectories $type]} { # add matching directories to $res if {[string length $pattern]} { - eval lappend res [namespace children ::${ns}::${path} $pattern] + eval [linsert [namespace children $nspath $pattern] 0 lappend res] } else { - if {[namespace exists ::${ns}::${path}]} { - eval lappend res ::${ns}::${path} + if {[namespace exists $nspath]} { + eval [linsert $nspath 0 lappend res] } } } @@ -127,14 +129,19 @@ proc vfs::ns::matchindirectory {ns path actualpath pattern type} { if {[::vfs::matchFiles $type]} { # add matching files to $res if {[string length $pattern]} { - eval lappend res [info procs ::${ns}::${path}::$pattern] + eval [linsert [info procs ${nspath}::$pattern] 0 lappend res] } else { - eval lappend res [info procs ::${ns}] + eval [linsert [info procs $ns] 0 lappend res] } } + + # There is a disconnect between 8.4 and 8.5 with the / handling + # Make sure actualpath gets just one trailing / + if {![string match */ $actualpath]} { append actualpath / } + set realres [list] foreach r $res { - regsub "^(::)?${ns}(::)?${path}(::)?" $r $actualpath/ rr + regsub "^(::)?${ns}(::)?${path}(::)?" $r $actualpath rr lappend realres $rr } #::vfs::log $realres