Browse Source

sync can cause NPE whith broken symlinks. PR 46747. Submitted by skoppehel at intersoft dot de

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@747004 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 16 years ago
parent
commit
1113e19f88
2 changed files with 6 additions and 1 deletions
  1. +4
    -0
      WHATSNEW
  2. +2
    -1
      src/main/org/apache/tools/ant/taskdefs/Sync.java

+ 4
- 0
WHATSNEW View File

@@ -356,6 +356,10 @@ Fixed bugs:
when writing zips or jars.
Bugzilla Report 45548

* <sync> could into a NullPointerException when faced with broken
symbolic links.
Bugzilla Report 46747.

Other changes:
--------------
* A HostInfo task was added performing information on hosts, including info on


+ 2
- 1
src/main/org/apache/tools/ant/taskdefs/Sync.java View File

@@ -235,7 +235,8 @@ public class Sync extends Task {
// delete them.
for (int i = dirs.length - 1; i >= 0; --i) {
File f = new File(toDir, dirs[i]);
if (f.list().length < 1) {
String[] children = f.list();
if (children == null || children.length < 1) {
log("Removing orphan directory: " + f, Project.MSG_DEBUG);
f.delete();
++removedCount[0];


Loading…
Cancel
Save