commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r806431 - in /commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar: ArArchiveEntry.java ArArchiveInputStream.java
Date Fri, 21 Aug 2009 07:05:08 GMT
Author: bodewig
Date: Fri Aug 21 07:05:07 2009
New Revision: 806431

URL: http://svn.apache.org/viewvc?rev=806431&view=rev
Log:
ar stores permissions as octal numbers, output stream does write them correctly, input stream
was reading them as decimal

Modified:
    commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveEntry.java
    commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java

Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveEntry.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveEntry.java?rev=806431&r1=806430&r2=806431&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveEntry.java
(original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveEntry.java
Fri Aug 21 07:05:07 2009
@@ -110,7 +110,7 @@
     public ArArchiveEntry(File inputFile, String entryName) {
         // TODO sort out mode
         this(entryName, inputFile.isFile() ? inputFile.length() : 0,
-             0, 0, 0, inputFile.lastModified() / 1000);
+             0, 0, DEFAULT_MODE, inputFile.lastModified() / 1000);
     }
 
     public long getSize() {

Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java?rev=806431&r1=806430&r2=806431&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java
(original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java
Fri Aug 21 07:05:07 2009
@@ -143,7 +143,7 @@
             temp = temp.substring(0, temp.length() - 1);
         }
         currentEntry = new ArArchiveEntry(temp, asLong(length), asInt(userid),
-                                          asInt(groupid), asInt(filemode),
+                                          asInt(groupid), asInt(filemode, 8),
                                           asLong(lastmodified));
         return currentEntry;
     }
@@ -153,7 +153,11 @@
     }
 
     private int asInt(byte[] input) {
-        return Integer.parseInt(new String(input).trim());
+        return asInt(input, 10);
+    }
+
+    private int asInt(byte[] input, int base) {
+        return Integer.parseInt(new String(input).trim(), base);
     }
 
     /*



Mime
View raw message