From: Wojciech Kocjan Date: Mon, 10 Mar 2014 11:40:46 +0000 (+0000) Subject: Fix for #92 vfs::zip unable to read zip archives with wrong modes X-Git-Url: https://privyetmir.co.uk/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2Fmaster;p=tclvfs Fix for #92 vfs::zip unable to read zip archives with wrong modes --- diff --git a/library/zipvfs.tcl b/library/zipvfs.tcl index 7cb00a6..80900ac 100644 --- a/library/zipvfs.tcl +++ b/library/zipvfs.tcl @@ -89,6 +89,11 @@ proc vfs::zip::stat {zipfd name} { if {($sb(mode) & 0xf000) == 0x2000} { set sb(mode) [expr {$sb(mode) ^ 0x2000}] } + # workaround for certain errorneus zip archives + if {($sb(mode) & 0xffff) == 0xffff} { + # change to directory type and set mode to 0777 + directory flag + set sb(mode) 0x41ff + } array get sb }