<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2723.2500" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>For uncompressed zip files (in my case this was a
jar archive made in Java), there is a small bug in the in zip.c at line
345</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV> finfo->uncompressed_position = newpos;</DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>should read:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV>
<DIV> finfo->uncompressed_position = newpos -
entry->offset;</DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>Without this fix, if you seek to the end of the
current file, a tell returns the offset into the zip and not the
'file'.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>On a related issue, when using a jar
created using the default mechanism in Java, zip_parse_local returns a
failure because the local header data for crc, compressed_size and
uncompressed_size are all zero. I guess Sun don't bother adding this info by
default. The BAIL_IF_MACRO macros checking these parameters against the
respective values from the zip index can be commented out and the file loads the
data fine. It is probably true that unless someone adds the CRCs lmanually
(like we ended up doing), any Jar creates by the standard Java classes
won't open under PhysFS. These files open in every other zip loader we have
tried out so I guess they don't care about this data either.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>My suggestion would be to remove the three
offending BAIL tests at lines 775, 777 & 779, in zip.c, as any corruption is
likely to be spotted by the other error checks. And this data isn't used by
PhysFS anyway.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>That's it,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Tree</FONT></DIV></DIV></BODY></HTML>