You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bo...@apache.org on 2012/12/27 22:49:43 UTC

svn commit: r1426339 - /ant/core/trunk/src/main/org/apache/tools/tar/TarOutputStream.java

Author: bodewig
Date: Thu Dec 27 21:49:43 2012
New Revision: 1426339

URL: http://svn.apache.org/viewvc?rev=1426339&view=rev
Log:
one more fix from Compress

Modified:
    ant/core/trunk/src/main/org/apache/tools/tar/TarOutputStream.java   (contents, props changed)

Modified: ant/core/trunk/src/main/org/apache/tools/tar/TarOutputStream.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/tar/TarOutputStream.java?rev=1426339&r1=1426338&r2=1426339&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/tar/TarOutputStream.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/tar/TarOutputStream.java Thu Dec 27 21:49:43 2012
@@ -485,14 +485,14 @@ public class TarOutputStream extends Fil
     void writePaxHeaders(String entryName,
                          Map<String, String> headers) throws IOException {
         String name = "./PaxHeaders.X/" + stripTo7Bits(entryName);
+        if (name.length() >= TarConstants.NAMELEN) {
+            name = name.substring(0, TarConstants.NAMELEN - 1);
+        }
         while (name.endsWith("/")) {
             // TarEntry's constructor would think this is a directory
             // and not allow any data to be written
             name = name.substring(0, name.length() - 1);
         }
-        if (name.length() >= TarConstants.NAMELEN) {
-            name = name.substring(0, TarConstants.NAMELEN - 1);
-        }
         TarEntry pex = new TarEntry(name,
                                     TarConstants.LF_PAX_EXTENDED_HEADER_LC);
 

Propchange: ant/core/trunk/src/main/org/apache/tools/tar/TarOutputStream.java
------------------------------------------------------------------------------
  Merged /commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveOutputStream.java:r1426338