[ https://issues.apache.org/jira/browse/COMPRESS-509?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17082974#comment-17082974 ]
Peter Lee commented on COMPRESS-509: ------------------------------------ Looks like we have added a '/' for a directory if its name is not ended with '/' - and this will only work for POSIX. And this will not happen if it's a OLD GNU or XSTAR tar. Basing on the comment in code, the adding of '/' for directory in POSIX looks like a fix for _SunOS tar -E._ Note that currently we are not adding '/' for a GNU long name entry - no matter it's POSIX, OLDGNU or XSTAR. Seems we have 2 options : # Just adding a '/' for a GNU long name entry if it's a directory(when the name is not ended with '/'). This seems to cause another similiar problem like this issue : for OLD GNU or XSTAR entries, the name of directories will not automatically add a '/' - on the other hand the '/' will be automatically if the entry is a GNU long name entry. # Adding a '/' for a GNU long name entry and the OLD GNU (maybe including XSTART?) entry. This will make OLD GNU entry and GNU long name entry work consistently. I prefer the second one. WDYT?[~bodewig] > The ambiguous behavior of the TarArchiveEntry.getName() method > -------------------------------------------------------------- > > Key: COMPRESS-509 > URL: https://issues.apache.org/jira/browse/COMPRESS-509 > Project: Commons Compress > Issue Type: Bug > Components: Archivers > Affects Versions: 1.18, 1.20 > Reporter: Petr Vasak > Assignee: Peter Lee > Priority: Minor > Attachments: Main.java > > > Scenario: To tar an empty directory and then to untar it. When the name is > longer than 100 characters, no ending slash appears. > Example: see attachment > Part of the output: > .. > dir/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ > dir/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ > dir/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa > dir/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa > .. -- This message was sent by Atlassian Jira (v8.3.4#803005)