From 452cbeefa25fc7ecaad58f2eb7bbaa0b7ea3aacf Mon Sep 17 00:00:00 2001 From: Andreas Kupries Date: Wed, 4 Aug 2004 21:49:08 +0000 Subject: [PATCH] * library/zipvfs.tcl: Fixed [SF Tclvfs Bug 1003574]. Added code preventing us from seeking before the beginning of the zip file. --- ChangeLog | 5 +++++ library/zipvfs.tcl | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index eda8f77..2d88782 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-08-04 Andreas Kupries + + * 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 * doc/vfs-fsapi.man: Clarified description of the close callback diff --git a/library/zipvfs.tcl b/library/zipvfs.tcl index 80e48d9..87f656d 100644 --- a/library/zipvfs.tcl +++ b/library/zipvfs.tcl @@ -328,7 +328,12 @@ proc zip::Data {fd arr {varPtr ""} {verify 0}} { 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} { -- 2.23.0