Check-in [1955802108]
Overview
Comment:Fixed issue with opening directories returning wrong error
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 1955802108b6786731ecfb9ddf4152c915610ca4
User & Date: rkeene on 2010-09-26 04:49:25
Other Links: manifest | tags
Context
2010-09-26
04:49
Renamed patch to more appropriate name check-in: e0bcd16a13 user: rkeene tags: trunk
04:49
Fixed issue with opening directories returning wrong error check-in: 1955802108 user: rkeene tags: trunk
04:49
Updated to not remount TclKit VFS in initialization check-in: c7d604dff8 user: rkeene tags: trunk
Changes

Modified tclvfs/patches/all/tclvfs-20080503-zipvfs-clock_and_append_to_exe.diff from [776417ea28] to [9b98f84953].

1
2
3
4











5
6
7
8
9
10
11
12
Binary files tclvfs-20080503.orig//library/.zipvfs.tcl.swp and tclvfs-20080503-1rsk//library/.zipvfs.tcl.swp differ
diff -uNr tclvfs-20080503.orig//library/zipvfs.tcl tclvfs-20080503-1rsk//library/zipvfs.tcl
--- tclvfs-20080503.orig//library/zipvfs.tcl	2008-04-15 16:11:53.000000000 -0500
+++ tclvfs-20080503-1rsk//library/zipvfs.tcl	2010-09-10 06:48:25.026165002 -0500











@@ -255,21 +255,21 @@
     set year [expr { (($date >> 9) & 0xFF) + 1980 }]
 
     # Fix up bad date/time data, no need to fail
-    while {$sec  > 59} {incr sec  -60}
-    while {$min  > 59} {incr sec  -60}
-    while {$hour > 23} {incr hour -24}
-    if {$mday < 1}  {incr mday}
<
|
|
|
>
>
>
>
>
>
>
>
>
>
>
|








1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

diff -uNr tclvfs-20080503.orig/library/zipvfs.tcl tclvfs-20080503-3rsk/library/zipvfs.tcl
--- tclvfs-20080503.orig/library/zipvfs.tcl	2008-04-15 16:11:53.000000000 -0500
+++ tclvfs-20080503-3rsk/library/zipvfs.tcl	2010-09-19 03:37:33.000000000 -0500
@@ -107,6 +107,10 @@
 	    
 	    ::zip::stat $zipfd $name sb
 
+            if {$sb(ino) == -1} {
+                vfs::filesystem posixerror $::vfs::posix(EISDIR)
+            }
+
 	    set nfd [vfs::memchan]
 	    fconfigure $nfd -translation binary
 
@@ -255,21 +259,21 @@
     set year [expr { (($date >> 9) & 0xFF) + 1980 }]
 
     # Fix up bad date/time data, no need to fail
-    while {$sec  > 59} {incr sec  -60}
-    while {$min  > 59} {incr sec  -60}
-    while {$hour > 23} {incr hour -24}
-    if {$mday < 1}  {incr mday}
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
-	# Only mday can be wrong, at end of month
-	incr mday -1
     }
+
     return $res
 }
 
@@ -400,6 +400,7 @@
 }
 
 proc zip::TOC {fd arr} {
+    upvar #0 zip::$fd cb
     upvar 1 $arr sb
 
     set buf [read $fd 46]
@@ -410,6 +411,8 @@
       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
 	error "bad central header: $x"
@@ -442,7 +445,7 @@
 	
 	zip::EndOfArchive $fd cb
 
-	seek $fd $cb(coff) start
+	seek $fd [expr {$cb(base) + $cb(coff)}] start
 
 	set toc(_) 0; unset toc(_); #MakeArray
 	







|







|








|








40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
-	# Only mday can be wrong, at end of month
-	incr mday -1
     }
+
     return $res
 }
 
@@ -400,6 +404,7 @@
 }
 
 proc zip::TOC {fd arr} {
+    upvar #0 zip::$fd cb
     upvar 1 $arr sb
 
     set buf [read $fd 46]
@@ -410,6 +415,8 @@
       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
 	error "bad central header: $x"
@@ -442,7 +449,7 @@
 	
 	zip::EndOfArchive $fd cb
 
-	seek $fd $cb(coff) start
+	seek $fd [expr {$cb(base) + $cb(coff)}] start
 
 	set toc(_) 0; unset toc(_); #MakeArray