| @@ -405,12 +405,7 @@ public class Tar extends MatchingTask { | |||||
| return; | return; | ||||
| } | } | ||||
| String prefix = tarFileSet.getPrefix(this.getProject()); | |||||
| // '/' is appended for compatibility with the zip task. | |||||
| if (!prefix.isEmpty() && !prefix.endsWith("/")) { | |||||
| prefix += "/"; | |||||
| } | |||||
| vPath = prefix + vPath; | |||||
| vPath = getCanonicalPrefix(tarFileSet, this.getProject()) + vPath; | |||||
| } else { | } else { | ||||
| vPath = fullpath; | vPath = fullpath; | ||||
| } | } | ||||
| @@ -785,6 +780,15 @@ public class Tar extends MatchingTask { | |||||
| return tfs; | return tfs; | ||||
| } | } | ||||
| private static String getCanonicalPrefix(TarFileSet tarFileSet, Project project) { | |||||
| String prefix = tarFileSet.getPrefix(project); | |||||
| // '/' is appended for compatibility with the zip task. | |||||
| if (prefix.isEmpty() || prefix.endsWith("/")) { | |||||
| return prefix; | |||||
| } | |||||
| return prefix += "/"; | |||||
| } | |||||
| /** | /** | ||||
| * This is a FileSet with the option to specify permissions | * This is a FileSet with the option to specify permissions | ||||
| * and other attributes. | * and other attributes. | ||||