diff --git a/src/main/org/apache/tools/ant/util/FileUtils.java b/src/main/org/apache/tools/ant/util/FileUtils.java
index 3e01bda5c..64e890ee2 100644
--- a/src/main/org/apache/tools/ant/util/FileUtils.java
+++ b/src/main/org/apache/tools/ant/util/FileUtils.java
@@ -299,7 +299,9 @@ public class FileUtils {
* @param file the "reference" file for relative paths. This
* instance must be an absolute file and must not contain
* "./" or "../" sequences (same for \ instead
- * of /).
+ * of /). If it is null, this call is equivalent to
+ * new java.io.File(filename)
.
+ *
* @param filename a file name
*
* @return an absolute file that doesn't contain "./" or
@@ -327,6 +329,10 @@ public class FileUtils {
return normalize(filename);
}
+ if (file == null) {
+ return new File(filename);
+ }
+
File helpFile = new File(file.getAbsolutePath());
StringTokenizer tok = new StringTokenizer(filename, File.separator);
while (tok.hasMoreTokens()) {
@@ -361,6 +367,9 @@ public class FileUtils {
*