fixed unzip

Steve Harrold swh at hpsmtc1.HP.COM
Thu Apr 13 04:54:21 AEST 1989


Re: The UNZIP program

Thank you for the "byte-swapped" and "nibble" corrections.

An additional correction is that the declaration for the "get_long()"
function should be "longint" rather than the default "int".  Failure to
do this ensures that the code calculates bad CRC32 checks on a machine
that has 16-bit ints.  The zip file is successfully extracted, but you
get a series of unsettling "bad" messages.

Furthermore, the "open()" functions have to set the file mode to include
the "O_BINARY" attribute for those environments that distinguish "text"
files from "binary" files (e.g. MSDOS).

An additional question is the use of the symbol "L_SET" in the original
posting.  This has a value of 0 (from file "file.h") but I think the 
symbol L_INCR (value = 1) should be used.  The XENIX adaptation sets
L_SET = 1 to achieve this purpose.

Can the original author comment on these fixes?



More information about the Alt.sources mailing list