diff --git a/src/main/org/apache/tools/ant/taskdefs/Expand.java b/src/main/org/apache/tools/ant/taskdefs/Expand.java index b3897efc6..039f203ff 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Expand.java +++ b/src/main/org/apache/tools/ant/taskdefs/Expand.java @@ -333,9 +333,9 @@ public class Expand extends Task { mappedNames = new String[] {entryName}; } File f = fileUtils.resolveFile(dir, mappedNames[0]); - if (!allowedOutsideOfDest && !fileUtils.isLeadingPath(dir, f)) { - log("skipping " + entryName + " as its target " + f + " is outside of " - + dir + ".", Project.MSG_VERBOSE); + if (!allowedOutsideOfDest && !fileUtils.isLeadingPath(dir, f, true)) { + log("skipping " + entryName + " as its target " + f.getCanonicalPath() + + " is outside of " + dir.getCanonicalPath() + ".", Project.MSG_VERBOSE); return; }