zipfile.c fails to calculate the CRC32 value if the compression method is explicitly set to 0. Example SQL:

  INSERT INTO zz(name, mode, mtime, data, method)
  VALUES('f.txt', '-rw-r--r--', 1000000000, 'abcde', 0);

As a result, a CRC32 value of 0 is written to the file. Some archive managers handle CRC32 discrepancies as errors, i.e. http://www.7-zip.org.

Extra braces around the highlighted if block ensure that CRC32 is calculated regardless of compression:

  http://www.sqlite.org/src/artifact?name=cc12e900e12eec23&ln=1340-1349

For testing purposes, it might be helpful to add a CRC32 column to the zipfile virtual table.

Ralf
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to