bodewig 01/05/03 05:27:53
Modified: src/main/org/apache/tools/ant/taskdefs Tar.java
Log:
Make sure, we don't add "" to the archive - zip has gotten the same
special treatment a few weeks ago.
PR: 1607
Revision Changes Path
1.16 +10 -4
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Tar.java
Index: Tar.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Tar.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- Tar.java 2001/03/19 12:44:33 1.15
+++ Tar.java 2001/05/03 12:27:52 1.16
@@ -157,7 +157,6 @@
// 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 @@
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)) {