From: Steve Huntley Date: Fri, 31 Dec 2010 04:56:44 +0000 (+0000) Subject: 2010-12-30 Steve Huntley X-Git-Url: http://privyetmir.co.uk/gitweb.cgi?a=commitdiff_plain;h=42f01472e85aafbf5df0c73f5332cc412576e019;p=tclvfs 2010-12-30 Steve Huntley * library/zipvfs.tcl: Wojciech Kocjan contributed tweaks to my latest "Frankenstein" patch, which I incorporated. --- diff --git a/ChangeLog b/ChangeLog index 33c2773..f2957a4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-12-30 Steve Huntley + + * library/zipvfs.tcl: Wojciech Kocjan contributed tweaks to my latest + "Frankenstein" patch, which I incorporated. + 2010-12-30 Steve Huntley * pkgIndex.tcl.in, vfs.tcl: Switched "package require Tcl 8.4" statement diff --git a/library/zipvfs.tcl b/library/zipvfs.tcl index ac0e0bb..65b6a39 100644 --- a/library/zipvfs.tcl +++ b/library/zipvfs.tcl @@ -154,7 +154,7 @@ proc vfs::zip::open {zipfd name mode permissions} { set nfd [vfs::memchan] fconfigure $nfd -translation binary - zip::Data $zipfd sb data + set data [zip::Data $zipfd sb 0] puts -nonewline $nfd $data @@ -454,13 +454,14 @@ proc zip::EndOfArchive {fd arr} { } } - set hdr [string range $hdr [expr $pos + 4] [expr $pos + 21]] + set hdrlen [string length $hdr] + set hdr [string range $hdr [expr $pos + 4] [expr $pos + 21]] - set seekstart [expr {wide([tell $fd]) + $pos - 512}] - if {$seekstart < 0} { - set seekstart 0 + set pos [expr {wide([tell $fd]) + $pos - $hdrlen}] + + if {$pos < 0} { + set pos 0 } - set pos [expr {$seekstart + $pos}] binary scan $hdr ssssiis \ cb(ndisk) cb(cdisk) \