preventing us from seeking before the beginning of the zip file.
+2004-08-04 Andreas Kupries <andreask@activestate.com>
+
+ * library/zipvfs.tcl: Fixed [SF Tclvfs Bug 1003574]. Added code
+ preventing us from seeking before the beginning of the zip file.
+
2004-07-15 Andreas Kupries <andreask@activestate.com>
* doc/vfs-fsapi.man: Clarified description of the close callback
proc zip::EndOfArchive {fd arr} {
upvar 1 $arr cb
- seek $fd -512 end
+ # [SF Tclvfs Bug 1003574]. Do not seek over beginning of file.
+ seek $fd 0 end
+ set n [tell $fd]
+ if {$n < 512} {set n -$n} else {set n -512}
+ seek $fd $n end
+
set hdr [read $fd 512]
set pos [string first "PK\05\06" $hdr]
if {$pos == -1} {