Browse Source

Make sure, we don't add "" to the archive - zip has gotten the same

special treatment a few weeks ago.

PR: 1607


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@269004 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 24 years ago
parent
commit
4b56e099f2
1 changed files with 10 additions and 4 deletions
  1. +10
    -4
      src/main/org/apache/tools/ant/taskdefs/Tar.java

+ 10
- 4
src/main/org/apache/tools/ant/taskdefs/Tar.java View File

@@ -157,7 +157,6 @@ public class Tar extends MatchingTask {
// add the main fileset to the list of filesets to process.
TarFileSet mainFileSet = new TarFileSet(fileset);
mainFileSet.setDir(baseDir);
mainFileSet.setDefaultexcludes(useDefaultExcludes);
filesets.addElement(mainFileSet);
}
@@ -237,9 +236,16 @@ public class Tar extends MatchingTask {
throws IOException
{
FileInputStream fIn = null;
if (file.isDirectory() && vPath.length() != 0
&& vPath.charAt(vPath.length() - 1) != '/')
vPath = vPath + "/";

// don't add "" to the archive
if (vPath.length() <= 0) {
return;
}
if (file.isDirectory() && !vPath.endsWith("/")) {
vPath += "/";
}

try {
if (vPath.length() >= TarConstants.NAMELEN) {
if (longFileMode.equalsIgnoreCase(OMIT)) {


Loading…
Cancel
Save