Differences From Artifact [f8be70e066]:
- File
kitsh/buildsrc/kitsh-0.0/zipvfs.tcl
— part of check-in
[77e40265de]
at
2010-09-26 04:49:35
on branch trunk
— Updated issue with opening directory
Updated to not panic if native encodings cannot be found (user: rkeene, size: 14120) [annotate] [blame] [check-ins using]
To Artifact [8fe7ed4f05]:
- File kitsh/buildsrc/kitsh-0.0/zipvfs.tcl — part of check-in [c0cb33bec5] at 2010-09-28 21:52:33 on branch trunk — Fixed issue with vfs::zip opening zip files smaller than 512b, fixes issue [0c5bcad642] (user: rkeene, size: 14293) [annotate] [blame] [check-ins using]
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
...
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
|
# ; # a buffer boundary, nor the header itself } else { break } } set hdr [string range $hdr [expr $pos + 4] [expr $pos + 21]] set pos [expr [tell $fd] + $pos - 512] binary scan $hdr ssssiis \ cb(ndisk) cb(cdisk) \ cb(nitems) cb(ntotal) \ cb(csize) cb(coff) \ cb(comment) ................................................................................ set cb(ndisk) [u_short $cb(ndisk)] set cb(nitems) [u_short $cb(nitems)] set cb(ntotal) [u_short $cb(ntotal)] set cb(comment) [u_short $cb(comment)] # Compute base for situations where ZIP file # has been appended to another media (e.g. EXE) set cb(base) [expr { $pos - $cb(csize) - $cb(coff) }] } proc zip::TOC {fd arr} { upvar #0 zip::$fd cb upvar 1 $arr sb set buf [read $fd 46] |
>
>
>
>
>
|
|
>
>
>
>
|
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
...
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
|
# ; # a buffer boundary, nor the header itself } else { break } } set hdr [string range $hdr [expr $pos + 4] [expr $pos + 21]] set seekstart [expr {[tell $fd] - 512}] if {$seekstart < 0} { set seekstart 0 } set pos [expr {$seekstart + $pos}] binary scan $hdr ssssiis \ cb(ndisk) cb(cdisk) \ cb(nitems) cb(ntotal) \ cb(csize) cb(coff) \ cb(comment) ................................................................................ set cb(ndisk) [u_short $cb(ndisk)] set cb(nitems) [u_short $cb(nitems)] set cb(ntotal) [u_short $cb(ntotal)] set cb(comment) [u_short $cb(comment)] # Compute base for situations where ZIP file # has been appended to another media (e.g. EXE) set base [expr { $pos - $cb(csize) - $cb(coff) }] if {$base < 0} { set base 0 } set cb(base) $base } proc zip::TOC {fd arr} { upvar #0 zip::$fd cb upvar 1 $arr sb set buf [read $fd 46] |