properly indicate "oldgnu" mode for long file name entries in tar.  COMPRESS-86

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/compress/trunk@823139 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index adcc70b..9b0be1f 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -23,6 +23,11 @@
   </properties>
   <body>
     <release version="1.1" date="as in SVN" description="Release 1.1">
+      <action type="fix" issue="COMPRESS-86" date="2009-10-08">
+        Tar archive entries holding the file name for names longer
+        than 100 characters in GNU longfile mode didn't properly
+        specify they'd be using the "oldgnu" extension.
+      </action>
       <action type="add" date="2009-08-25">
         A new constructor of TarArchiveEntry can create entries with
         names that start with slashes - the default is to strip
diff --git a/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java b/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
index a7a3139..79967c9 100644
--- a/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
+++ b/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
@@ -210,6 +210,10 @@
     public TarArchiveEntry(String name, byte linkFlag) {
         this(name);
         this.linkFlag = linkFlag;
+        if (linkFlag == LF_GNUTYPE_LONGNAME) {
+            magic = MAGIC_GNU;
+            version = VERSION_GNU_SPACE;
+        }
     }
 
     /**