You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by bo...@apache.org on 2016/02/05 20:42:56 UTC
[1/2] commons-compress git commit: COMPRESS-334 alterantive fix
Repository: commons-compress
Updated Branches:
refs/heads/master 36335e3fa -> 9431b16c5
COMPRESS-334 alterantive fix
Project: http://git-wip-us.apache.org/repos/asf/commons-compress/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-compress/commit/b4805bb1
Tree: http://git-wip-us.apache.org/repos/asf/commons-compress/tree/b4805bb1
Diff: http://git-wip-us.apache.org/repos/asf/commons-compress/diff/b4805bb1
Branch: refs/heads/master
Commit: b4805bb1f3ed74ff260e73f571195102f435f55d
Parents: 36335e3
Author: Stefan Bodewig <bo...@apache.org>
Authored: Fri Feb 5 20:42:09 2016 +0100
Committer: Stefan Bodewig <bo...@apache.org>
Committed: Fri Feb 5 20:42:09 2016 +0100
----------------------------------------------------------------------
.../commons/compress/archivers/ar/ArArchiveInputStream.java | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-compress/blob/b4805bb1/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java b/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java
index 99d90e3..79bcceb 100644
--- a/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java
+++ b/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java
@@ -345,9 +345,7 @@ public class ArArchiveInputStream extends ArchiveInputStream {
int nameLen =
Integer.parseInt(bsdLongName.substring(BSD_LONGNAME_PREFIX_LEN));
byte[] name = new byte[nameLen];
- int read = IOUtils.readFully(input, name);
- count(read);
- offset += read > 0 ? read : 0;
+ int read = IOUtils.readFully(this, name);
if (read != nameLen) {
throw new EOFException();
}
[2/2] commons-compress git commit: COMPRESS-334 unit tests with more
than one entry
Posted by bo...@apache.org.
COMPRESS-334 unit tests with more than one entry
Project: http://git-wip-us.apache.org/repos/asf/commons-compress/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-compress/commit/9431b16c
Tree: http://git-wip-us.apache.org/repos/asf/commons-compress/tree/9431b16c
Diff: http://git-wip-us.apache.org/repos/asf/commons-compress/diff/9431b16c
Branch: refs/heads/master
Commit: 9431b16c58a3fbb320cf13af80cb36430f2aea79
Parents: b4805bb
Author: Stefan Bodewig <bo...@apache.org>
Authored: Fri Feb 5 20:42:31 2016 +0100
Committer: Stefan Bodewig <bo...@apache.org>
Committed: Fri Feb 5 20:42:31 2016 +0100
----------------------------------------------------------------------
.../compress/archivers/ar/ArArchiveInputStreamTest.java | 6 ++++++
src/test/resources/longfile_bsd.ar | 2 ++
src/test/resources/longfile_gnu.ar | 7 +++++--
3 files changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-compress/blob/9431b16c/src/test/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStreamTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStreamTest.java b/src/test/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStreamTest.java
index ae09d63..d62d3a0 100644
--- a/src/test/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStreamTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStreamTest.java
@@ -51,6 +51,12 @@ public class ArArchiveInputStreamTest extends AbstractTestCase {
byte[] hello = new byte[14];
s.read(hello);
assertEquals("Hello, world!\n", ArchiveUtils.toAsciiString(hello));
+ e = s.getNextEntry();
+ assertEquals("this_is_a_long_file_name_as_well.txt", e.getName());
+ assertEquals(4, e.getSize());
+ byte[] bye = new byte[4];
+ s.read(bye);
+ assertEquals("Bye\n", ArchiveUtils.toAsciiString(bye));
assertNull(s.getNextEntry());
} finally {
if (s != null) {
http://git-wip-us.apache.org/repos/asf/commons-compress/blob/9431b16c/src/test/resources/longfile_bsd.ar
----------------------------------------------------------------------
diff --git a/src/test/resources/longfile_bsd.ar b/src/test/resources/longfile_bsd.ar
index 7b0fd51..f7c3682 100644
--- a/src/test/resources/longfile_bsd.ar
+++ b/src/test/resources/longfile_bsd.ar
@@ -1,3 +1,5 @@
!<arch>
#1/28 1311256511 1000 1000 100644 42 `
this_is_a_long_file_name.txtHello, world!
+#1/36 1454694016 1000 1000 100664 40 `
+this_is_a_long_file_name_as_well.txtBye
http://git-wip-us.apache.org/repos/asf/commons-compress/blob/9431b16c/src/test/resources/longfile_gnu.ar
----------------------------------------------------------------------
diff --git a/src/test/resources/longfile_gnu.ar b/src/test/resources/longfile_gnu.ar
index 22d4c03..12799a0 100644
--- a/src/test/resources/longfile_gnu.ar
+++ b/src/test/resources/longfile_gnu.ar
@@ -1,5 +1,8 @@
!<arch>
-// 30 `
+// 68 `
this_is_a_long_file_name.txt/
-/0 1311256511 1000 1000 100644 14 `
+this_is_a_long_file_name_as_well.txt/
+/0 1454693980 1000 1000 100664 14 `
Hello, world!
+/30 1454694016 1000 1000 100664 4 `
+Bye