The jar utility from jdk 1.30. adds an entry for the directory META-INF, 
whose size and CRC is zero. kaffe's jar incorrectly barfs at this. I've 
attached a diff to solve this problem.

BTW, shouldn't kaffe's jar add entries for directories, like Sun's jars do?

Thank you for your work at Kaffe!

Index: ZipInputStream.java
===================================================================
RCS file: /cvs/kaffe/kaffe/libraries/javalib/java/util/zip/ZipInputStream.java,v
retrieving revision 1.11
diff -u -r1.11 ZipInputStream.java
--- ZipInputStream.java	2000/02/23 18:01:25	1.11
+++ ZipInputStream.java	2001/05/06 21:17:37
@@ -133,24 +133,17 @@
 
 	  // Read CRC
 	  int data_crc = get32(dheader, DATA_CRC);
-	  if (data_crc == 0) {
-	      throw new IOException("CRC of 0 is not valid in a DATA header");
-	  }
 	  entry.setCrc(data_crc & 0xffffffffL);
 
 	  // Read compressed size
 	  int data_csize = get32(dheader, DATA_COMPRESSEDSIZE);
-	  if (data_csize == 0) {
-	      throw new IOException(
-		"COMPRESSEDSIZE of 0 is not valid in a DATA header");
-	  }
 	  entry.setCompressedSize(data_csize & 0xffffffffL);
 
 	  // Read uncompressed size
 	  int data_size = get32(dheader, DATA_UNCOMPRESSEDSIZE);
-	  if (data_size == 0) {
+	  if (data_crc == 0 && data_size != 0) {
 	      throw new IOException(
-		"UNCOMPRESSEDSIZE os 0 is not valid in a DATA header");
+		"CRC error: data_crc=0, data_csize=" + data_csize + ",data_size=" + data_size);
 	  }
 	  entry.setSize(data_size & 0xffffffffL);
 

Reply via email to