From 97a6fbada2b8b7b03da81aa3f9abec798c913dbf Mon Sep 17 00:00:00 2001
From: Steve Huntley <stephen.huntley@alum.mit.edu>
Date: Wed, 30 Mar 2011 06:44:42 +0000
Subject: [PATCH] 2011-03-30  Steve Huntley  <stephen.huntley@alum.mit.edu>

	* vfslib.tcl, zipvfs.tcl: Added contributed patches to fix bugs 3160686
	& 3224057.
---
 ChangeLog          | 5 +++++
 library/vfslib.tcl | 2 ++
 library/zipvfs.tcl | 2 --
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 504f687..0b72310 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-03-30  Steve Huntley  <stephen.huntley@alum.mit.edu>
+
+	* vfslib.tcl, zipvfs.tcl: Added contributed patches to fix bugs 3160686
+	& 3224057.
+
 2011-03-30  Steve Huntley  <stephen.huntley@alum.mit.edu>
 
 	* globfind.tcl: Updated to latest file version (1.5.3).
diff --git a/library/vfslib.tcl b/library/vfslib.tcl
index c03d05c..4d8e030 100644
--- a/library/vfslib.tcl
+++ b/library/vfslib.tcl
@@ -192,7 +192,9 @@ if {[info command ::chan] ne {}} {
         set ::vfs::_memchan_nam($fd) $filename
 	return $fd
     }
+}
 
+if {[info command rechan] ne "" || ![catch {load "" rechan}]} {
     proc vfs::zstream_handler {zcmd ifd clen ilen imode cmd fd {a1 ""} {a2 ""}} {
 	#puts stderr "z $zcmd $ifd $ilen $cmd $fd $a1 $a2"
 	upvar ::vfs::_zstream_pos($fd) pos
diff --git a/library/zipvfs.tcl b/library/zipvfs.tcl
index 65b6a39..191c2a2 100644
--- a/library/zipvfs.tcl
+++ b/library/zipvfs.tcl
@@ -500,8 +500,6 @@ proc zip::TOC {fd arr} {
       flen elen clen sb(disk) sb(attr) \
       sb(atx) sb(ino)
 
-    set sb(ino) [expr {$cb(base) + $sb(ino)}]
-
     if { ![string equal "PK\01\02" $hdr] } {
 	binary scan $hdr H* x
 	return -code error "bad central header: $x"
-- 
2.23.0