Diff

Differences From Artifact [734aa55ae1]:

To Artifact [952d380c4b]:


   235    235       proc u_short {n}  { return [expr { ($n+0x10000)%0x10000 }] }
   236    236   }
   237    237   
   238    238   proc zip::DosTime {date time} {
   239    239       # The pre-VFS environment will not have access to "clock", so don't even
   240    240       # bother
   241    241       return 0
   242         -
   243         -    set time [u_short $time]
   244         -    set date [u_short $date]
   245         -
   246         -    # time = fedcba9876543210
   247         -    #        HHHHHmmmmmmSSSSS (sec/2 actually)
   248         -
   249         -    # data = fedcba9876543210
   250         -    #        yyyyyyyMMMMddddd
   251         -
   252         -    set sec  [expr { ($time & 0x1F) * 2 }]
   253         -    set min  [expr { ($time >> 5) & 0x3F }]
   254         -    set hour [expr { ($time >> 11) & 0x1F }]
   255         -
   256         -    set mday [expr { $date & 0x1F }]
   257         -    set mon  [expr { (($date >> 5) & 0xF) }]
   258         -    set year [expr { (($date >> 9) & 0xFF) + 1980 }]
   259         -
   260         -    # Fix up bad date/time data, no need to fail
   261         -    if {$sec  > 59} {set sec  59}
   262         -    if {$min  > 59} {set sec  59}
   263         -    if {$hour > 23} {set hour 23}
   264         -    if {$mday < 1}  {set mday 1}
   265         -    if {$mday > 35} {set mday 35}
   266         -    if {$mon  < 1}  {set mon  1}
   267         -    if {$mon > 12}  {set mon  12}
   268         -
   269         -    set res 0
   270         -    while {$mday > 1 && [catch {
   271         -	set dt [format {%4.4d-%2.2d-%2.2d %2.2d:%2.2d:%2.2d} \
   272         -		    $year $mon $mday $hour $min $sec]
   273         -	set res [clock scan $dt -gmt 1]
   274         -    }]} {
   275         -	# Only mday can be wrong, at end of month
   276         -	incr mday -1
   277         -    }
   278         -
   279         -    return $res
   280    242   }
   281    243   
   282    244   
   283    245   proc zip::Data {fd arr {varPtr ""} {verify 0}} {
   284    246       upvar 1 $arr sb
   285    247   
   286    248       if { $varPtr != "" } {