From: Jeff Hobbs Date: Wed, 3 Dec 2008 08:07:59 +0000 (+0000) Subject: * library/tclprocvfs.tcl (vfs::ns::matchindirectory): Handle the X-Git-Tag: vfs-1-4~2 X-Git-Url: https://privyetmir.co.uk/gitweb.cgi?a=commitdiff_plain;h=40191f15f5b89e4b47a0a2329ffe42b53348e522;p=tclvfs * library/tclprocvfs.tcl (vfs::ns::matchindirectory): Handle the single item dir/file, and don't add a slash for single proc. --- diff --git a/ChangeLog b/ChangeLog index 9805820..c1f917b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-12-03 Jeff Hobbs + + * library/tclprocvfs.tcl (vfs::ns::matchindirectory): Handle the + single item dir/file, and don't add a slash for single proc. + 2008-12-02 Jeff Hobbs * tests/vfs.test (vfs-2.3,2.4,4.1): add tests for mount command diff --git a/library/tclprocvfs.tcl b/library/tclprocvfs.tcl index 85b792c..4287eeb 100644 --- a/library/tclprocvfs.tcl +++ b/library/tclprocvfs.tcl @@ -115,14 +115,13 @@ proc vfs::ns::matchindirectory {ns path actualpath pattern type} { set ns ::[string trim $ns :] set nspath ${ns}::${path} + set slash 1 if {[::vfs::matchDirectories $type]} { # add matching directories to $res if {[string length $pattern]} { eval [linsert [namespace children $nspath $pattern] 0 lappend res] - } else { - if {[namespace exists $nspath]} { - eval [linsert $nspath 0 lappend res] - } + } elseif {[namespace exists $nspath]} { + lappend res $nspath } } @@ -130,14 +129,15 @@ proc vfs::ns::matchindirectory {ns path actualpath pattern type} { # add matching files to $res if {[string length $pattern]} { eval [linsert [info procs ${nspath}::$pattern] 0 lappend res] - } else { - eval [linsert [info procs $ns] 0 lappend res] + } elseif {[llength [info procs $nspath]]} { + lappend res $nspath + set slash 0 } } # 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 / } + if {$slash && ![string match */ $actualpath]} { append actualpath / } set realres [list] foreach r $res {