commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r942695 - /commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
Date Mon, 10 May 2010 09:36:16 GMT
Author: sebb
Date: Mon May 10 09:36:15 2010
New Revision: 942695

URL: http://svn.apache.org/viewvc?rev=942695&view=rev
Log:
SunOS tar -E does not add / to directory names, so fix up to be consistent

Modified:
    commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java

Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java?rev=942695&r1=942694&r2=942695&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
(original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
Mon May 10 09:36:15 2010
@@ -673,6 +673,10 @@ public class TarArchiveEntry implements 
         devMinor = (int) TarUtils.parseOctal(header, offset, DEVLEN);
         offset += DEVLEN;
         String prefix = TarUtils.parseName(header, offset, PREFIXLEN);
+        // SunOS tar -E does not add / to directory names, so fix up to be consistent
+        if (isDirectory() && !name.endsWith("/")){
+            name = name + "/";
+        }
         if (prefix.length() >0){
             name = prefix + "/" + name;
         }



Mime
View raw message