From: Vince Darley Date: Sat, 8 Feb 2003 15:08:17 +0000 (+0000) Subject: robustness improvement of all vfs X-Git-Tag: vfs-1-3~59 X-Git-Url: http://privyetmir.co.uk/gitweb?a=commitdiff_plain;h=d581b6fb99da23502e7d234652653266e8afb81b;p=tclvfs robustness improvement of all vfs --- diff --git a/ChangeLog b/ChangeLog index 21320d0..762e3c5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2003-02-08 Vince Darley + + * library/*.tcl: made all 'matchindirectory' implementations + robust to whether they are passed a directory with a trailing + file-separator or not. (Tcl doesn't document whether there + will be one, and optimisations to Tcl's filesystem require + this flexibility. Also the use of 'file join' will actually + make the entire filesystem *more* efficient soon). + 2003-02-06 Andreas Kupries * tclconfig/tcl.m4: Added SC_TCL_EARLY_FLAGS and diff --git a/library/ftpvfs.tcl b/library/ftpvfs.tcl index 8250573..9baaa30 100644 --- a/library/ftpvfs.tcl +++ b/library/ftpvfs.tcl @@ -235,12 +235,12 @@ proc vfs::ftp::matchindirectory {fd path actualpath pattern type} { } if {[::vfs::matchDirectories $type]} { if {[string index $perms 0] == "d"} { - lappend res "$actualpath$name" + lappend res [file join $actualpath $name] } } if {[::vfs::matchFiles $type]} { if {[string index $perms 0] != "d"} { - lappend res "$actualpath$name" + lappend res [file join $actualpath $name] } } diff --git a/library/mk4vfs.tcl b/library/mk4vfs.tcl index f0df8fd..db7c143 100644 --- a/library/mk4vfs.tcl +++ b/library/mk4vfs.tcl @@ -85,7 +85,7 @@ namespace eval vfs::mk4 { set res [::mk4vfs::getdir $db $path $pattern] } foreach p [::vfs::matchCorrectTypes $type $res $actualpath] { - lappend newres "$actualpath$p" + lappend newres [file join $actualpath $p] } return $newres } diff --git a/library/tarvfs.tcl b/library/tarvfs.tcl index cba6b20..2369ff9 100644 --- a/library/tarvfs.tcl +++ b/library/tarvfs.tcl @@ -60,7 +60,7 @@ proc vfs::tar::matchindirectory {tarfd path actualpath pattern type} { set newres [list] foreach p [::vfs::matchCorrectTypes $type $res $actualpath] { - lappend newres "$actualpath$p" + lappend newres [file join $actualpath $p] } return $newres } diff --git a/library/webdavvfs.tcl b/library/webdavvfs.tcl index cce1f93..a59a2e9 100644 --- a/library/webdavvfs.tcl +++ b/library/webdavvfs.tcl @@ -203,9 +203,10 @@ proc vfs::webdav::matchindirectory {dirurl extraHeadersList path actualpath patt if {[string match $pattern $name]} { puts "check: $name" if {$type == 0} { - lappend res $actualpath$name + lappend res [file join $actualpath $name] } else { - eval lappend res [_matchtypes $item $actualpath$name $type] + eval lappend res [_matchtypes $item \ + [file join $actualpath $name] $type] } } #puts "got: $res" diff --git a/library/zipvfs.tcl b/library/zipvfs.tcl index 56da6c1..9adde8f 100644 --- a/library/zipvfs.tcl +++ b/library/zipvfs.tcl @@ -57,7 +57,7 @@ proc vfs::zip::matchindirectory {zipfd path actualpath pattern type} { set newres [list] foreach p [::vfs::matchCorrectTypes $type $res $actualpath] { - lappend newres "$actualpath$p" + lappend newres [file join $actualpath $p] } #::vfs::log "got $newres" return $newres