ZipInputStream.java (getNextEntry): When reading file headers, don't include `size...
authorTom Tromey <tromey@cygnus.com>
Thu, 11 May 2000 17:05:03 +0000 (17:05 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Thu, 11 May 2000 17:05:03 +0000 (17:05 +0000)
* java/util/zip/ZipInputStream.java (getNextEntry): When reading
file headers, don't include `size' in the skip call.

From-SVN: r33850

libjava/ChangeLog
libjava/java/util/zip/ZipInputStream.java

index 00330e0d94015c59512c880d6b00ed8745c6394f..1117267322110b8e3dc9e26a28f6971e18d05e2a 100644 (file)
@@ -1,3 +1,8 @@
+2000-05-11  Tom Tromey  <tromey@cygnus.com>
+
+       * java/util/zip/ZipInputStream.java (getNextEntry): When reading
+       file headers, don't include `size' in the skip call.
+
 2000-05-10  Bryce McKinlay  <bryce@albatross.co.nz>
 
        * java/lang/StringBuffer.java (delete): Call arrayCopy() correctly.
index df0ef03d5885aa2967c9d1aacd7705899724857d..492cf67c73391a12ede38d0e6c3c5beab8fc550a 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999  Free Software Foundation
+/* Copyright (C) 1999, 2000  Free Software Foundation
 
    This file is part of libgcj.
 
@@ -52,7 +52,13 @@ public class ZipInputStream extends InflaterInputStream implements ZipConstants
        int fname_length = readu2();
        int extra_length = readu2();
        int fcomment_length = readu2();
-       in.skip(12+fname_length+extra_length+fcomment_length+size);
+       // `12' is the number of bytes between the comment length
+       // field and the end of the fixed part of the header:
+       // 2 bytes for `disk number start'
+       // 2 bytes for `internal file attributes'
+       // 4 bytes for `external file attributes'
+       // 4 bytes for `relative offset of local header'
+       in.skip(12 + fname_length + extra_length + fcomment_length);
        if (in.read() != 'P' || in.read() != 'K')
          return null;
        code = in.read();